库区管理

product
chuang 2 years ago
parent 73dcc3513b
commit 5123311151

@ -1,63 +1,54 @@
package jnpf.reservoirarea.controller; package jnpf.reservoirarea.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; 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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import jnpf.base.ActionResult; import jnpf.base.ActionResult;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.UserInfo; import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO; import jnpf.base.vo.DownloadVO;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.exception.DataException; import jnpf.exception.DataException;
import org.springframework.transaction.annotation.Transactional; import jnpf.reservoirarea.entity.ReservoirareaEntity;
import jnpf.base.entity.ProvinceEntity;
import jnpf.reservoirarea.model.reservoirarea.*; import jnpf.reservoirarea.model.reservoirarea.*;
import jnpf.reservoirarea.model.reservoirarea.ReservoirareaPagination; import jnpf.reservoirarea.service.ReservoirareaService;
import jnpf.reservoirarea.entity.*;
import jnpf.util.*; import jnpf.util.*;
import jnpf.base.util.*; import jnpf.util.enums.FileTypeEnum;
import jnpf.base.vo.ListVO; import jnpf.util.file.UploadUtil;
import jnpf.util.context.SpringContext;
import cn.hutool.core.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j;
import lombok.Cleanup; import lombok.Cleanup;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import jnpf.reservoirarea.entity.ReservoirareaEntity;
import jnpf.reservoirarea.service.ReservoirareaService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired; 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 javax.validation.Valid;
import java.io.FileNotFoundException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import jnpf.util.GeneraterSwapUtil; import java.util.ArrayList;
import java.util.*; import java.util.HashMap;
import java.util.List;
import jnpf.util.file.UploadUtil; import java.util.Map;
import jnpf.util.enums.FileTypeEnum;
/** /**
* *
* reservoirarea *
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Slf4j @Slf4j
@RestController @RestController
@Api(tags = "reservoirarea" , value = "reservoirarea") @Api(tags = "库区管理" , value = "example")
@RequestMapping("/api/reservoirarea/Reservoirarea") @RequestMapping("/api/example/Reservoirarea")
public class ReservoirareaController { public class ReservoirareaController {
@Autowired @Autowired
@ -87,9 +78,7 @@ public class ReservoirareaController {
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(ReservoirareaEntity entity:list){ for(ReservoirareaEntity entity:list){
Map<String,Object> warehouseIdMap = new HashMap<>(); Map<String,Object> warehouseIdMap = new HashMap<>();
entity.setWarehouseId(generaterSwapUtil.getPopupSelectValue("380988259175524165","id","name",entity.getWarehouseId(),warehouseIdMap)); entity.setWarehouseId(generaterSwapUtil.getPopupSelectValue("394860934465658373","id","NAME",entity.getWarehouseId(),warehouseIdMap));
entity.setOrgnizeId(generaterSwapUtil.comSelectValues(entity.getOrgnizeId()));
entity.setDepartmentId(generaterSwapUtil.comSelectValues(entity.getDepartmentId()));
} }
List<ReservoirareaListVO> listVO=JsonUtil.getJsonToList(list,ReservoirareaListVO.class); List<ReservoirareaListVO> listVO=JsonUtil.getJsonToList(list,ReservoirareaListVO.class);
for(ReservoirareaListVO reservoirareaVO:listVO){ for(ReservoirareaListVO reservoirareaVO:listVO){
@ -115,6 +104,7 @@ public class ReservoirareaController {
public ActionResult create(@RequestBody @Valid ReservoirareaCrForm reservoirareaCrForm) throws DataException { public ActionResult create(@RequestBody @Valid ReservoirareaCrForm reservoirareaCrForm) throws DataException {
String mainId =RandomUtil.uuId(); String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
reservoirareaCrForm.setCreatorTime(DateUtil.getNow());
ReservoirareaEntity entity = JsonUtil.getJsonToBean(reservoirareaCrForm, ReservoirareaEntity.class); ReservoirareaEntity entity = JsonUtil.getJsonToBean(reservoirareaCrForm, ReservoirareaEntity.class);
entity.setId(mainId); entity.setId(mainId);
reservoirareaService.save(entity); reservoirareaService.save(entity);
@ -159,9 +149,7 @@ public class ReservoirareaController {
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(ReservoirareaEntity entity:list){ for(ReservoirareaEntity entity:list){
Map<String,Object> warehouseIdMap = new HashMap<>(); Map<String,Object> warehouseIdMap = new HashMap<>();
entity.setWarehouseId(generaterSwapUtil.swapRelationFormValue("comInputField109",entity.getWarehouseId(),"294090217084722181",warehouseIdMap)); entity.setWarehouseId(generaterSwapUtil.getPopupSelectValue("394860934465658373","id","NAME",entity.getWarehouseId(),warehouseIdMap));
entity.setOrgnizeId(generaterSwapUtil.comSelectValues(entity.getOrgnizeId()));
entity.setDepartmentId(generaterSwapUtil.comSelectValues(entity.getDepartmentId()));
} }
List<ReservoirareaListVO> listVO=JsonUtil.getJsonToList(list,ReservoirareaListVO.class); List<ReservoirareaListVO> listVO=JsonUtil.getJsonToList(list,ReservoirareaListVO.class);
for(ReservoirareaListVO reservoirareaVO:listVO){ for(ReservoirareaListVO reservoirareaVO:listVO){
@ -202,23 +190,11 @@ public class ReservoirareaController {
case "warehouseId" : case "warehouseId" :
entitys.add(new ExcelExportEntity("仓库" ,"warehouseId")); entitys.add(new ExcelExportEntity("仓库" ,"warehouseId"));
break; break;
case "orgnizeId" : case "creatorTime" :
entitys.add(new ExcelExportEntity("组织" ,"orgnizeId")); entitys.add(new ExcelExportEntity("创建时间" ,"creatorTime"));
break;
case "departmentId" :
entitys.add(new ExcelExportEntity("部门" ,"departmentId"));
break;
case "creatortime" :
entitys.add(new ExcelExportEntity("创建时间" ,"creatortime"));
break;
case "creatorusername" :
entitys.add(new ExcelExportEntity("创建人名称" ,"creatorusername"));
break; break;
case "lastmodifytime" : case "lastModifyTime" :
entitys.add(new ExcelExportEntity("修改时间" ,"lastmodifytime")); entitys.add(new ExcelExportEntity("修改时间" ,"lastModifyTime"));
break;
case "lastmodifyusername" :
entitys.add(new ExcelExportEntity("修改人名称" ,"lastmodifyusername"));
break; break;
default: default:
break; break;
@ -283,6 +259,12 @@ public class ReservoirareaController {
public ActionResult<ReservoirareaInfoVO> info(@PathVariable("id") String id){ public ActionResult<ReservoirareaInfoVO> info(@PathVariable("id") String id){
ReservoirareaEntity entity= reservoirareaService.getInfo(id); ReservoirareaEntity entity= reservoirareaService.getInfo(id);
ReservoirareaInfoVO vo=JsonUtil.getJsonToBean(entity, ReservoirareaInfoVO.class); ReservoirareaInfoVO vo=JsonUtil.getJsonToBean(entity, ReservoirareaInfoVO.class);
if(vo.getCreatorTime()!=null){
vo.setCreatorTime(vo.getCreatorTime());
}
if(vo.getLastModifyTime()!=null){
vo.setLastModifyTime(vo.getLastModifyTime());
}
//子表 //子表
//副表 //副表
@ -306,9 +288,7 @@ public class ReservoirareaController {
//添加到详情表单对象中 //添加到详情表单对象中
Map<String,Object> warehouseIdMap = new HashMap<>(); Map<String,Object> warehouseIdMap = new HashMap<>();
vo.setWarehouseId(generaterSwapUtil.swapRelationFormValue("comInputField109",vo.getWarehouseId(),"294090217084722181",warehouseIdMap)); vo.setWarehouseId(generaterSwapUtil.getPopupSelectValue("394860934465658373","id","NAME",vo.getWarehouseId(),warehouseIdMap));
vo.setOrgnizeId(generaterSwapUtil.comSelectValues(vo.getOrgnizeId()));
vo.setDepartmentId(generaterSwapUtil.comSelectValues(vo.getDepartmentId()));
return ActionResult.success(vo); return ActionResult.success(vo);
} }
@ -328,7 +308,9 @@ public class ReservoirareaController {
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
ReservoirareaEntity entity= reservoirareaService.getInfo(id); ReservoirareaEntity entity= reservoirareaService.getInfo(id);
if(entity!=null){ if(entity!=null){
reservoirareaUpForm.setLastModifyTime(DateUtil.getNow());
ReservoirareaEntity subentity=JsonUtil.getJsonToBean(reservoirareaUpForm, ReservoirareaEntity.class); ReservoirareaEntity subentity=JsonUtil.getJsonToBean(reservoirareaUpForm, ReservoirareaEntity.class);
subentity.setCreatorTime(entity.getCreatorTime());
reservoirareaService.update(id, subentity); reservoirareaService.update(id, subentity);
return ActionResult.success("更新成功"); return ActionResult.success("更新成功");
}else{ }else{

@ -16,7 +16,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Data @Data
@TableName("jg_reservoirarea") @TableName("jg_reservoirarea")
@ -26,34 +26,34 @@ public class ReservoirareaEntity {
private String id; private String id;
@TableField("CREATOR_USER_ID") @TableField("CREATOR_USER_ID")
private String creatoruserid; private String creatorUserId;
@TableField("CREATOR_USER_NAME") @TableField("CREATOR_USER_NAME")
private String creatorusername; private String creatorUserName;
@TableField("CREATOR_TIME") @TableField("CREATOR_TIME")
private Date creatortime; private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID") @TableField("LAST_MODIFY_USER_ID")
private String lastmodifyuserid; private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME") @TableField("LAST_MODIFY_USER_NAME")
private String lastmodifyusername; private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME") @TableField("LAST_MODIFY_TIME")
private Date lastmodifytime; private Date lastModifyTime;
@TableField("DELETE_USER_ID") @TableField("DELETE_USER_ID")
private String deleteuserid; private String deleteUserId;
@TableField("DELETE_USER_NAME") @TableField("DELETE_USER_NAME")
private String deleteusername; private String deleteUserName;
@TableField("DELETE_TIME") @TableField("DELETE_TIME")
private Date deletetime; private Date deleteTime;
@TableField("DELETE_MARK") @TableField("DELETE_MARK")
private String deletemark; private String deleteMark;
@TableField("ORGNIZE_ID") @TableField("ORGNIZE_ID")
private String orgnizeId; private String orgnizeId;
@ -82,4 +82,10 @@ public class ReservoirareaEntity {
@TableField("UNIT") @TableField("UNIT")
private String unit; private String unit;
@TableField("CLOSE_NUM")
private Integer closeNum;
@TableField("CLOSE_TIME")
private Date closeTime;
} }

@ -1,16 +1,16 @@
package jnpf.reservoirarea.mapper; package jnpf.reservoirarea.mapper;
import jnpf.reservoirarea.entity.ReservoirareaEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.reservoirarea.entity.ReservoirareaEntity;
/** /**
* *
* reservoirarea *
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-05 * 2023-02-13
*/ */
public interface ReservoirareaMapper extends BaseMapper<ReservoirareaEntity> { public interface ReservoirareaMapper extends BaseMapper<ReservoirareaEntity> {

@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Data @Data
public class ReservoirareaCrForm { public class ReservoirareaCrForm {
@ -47,29 +47,13 @@ public class ReservoirareaCrForm {
@JsonProperty("warehouseId") @JsonProperty("warehouseId")
private String warehouseId; private String warehouseId;
/** 组织 **/
@JsonProperty("orgnizeId")
private String orgnizeId;
/** 部门 **/
@JsonProperty("departmentId")
private String departmentId;
/** 创建时间 **/ /** 创建时间 **/
@JsonProperty("creatortime") @JsonProperty("creatorTime")
private Long creatortime; private String creatorTime;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
/** 修改时间 **/ /** 修改时间 **/
@JsonProperty("lastmodifytime") @JsonProperty("lastModifyTime")
private Long lastmodifytime; private String lastModifyTime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;

@ -15,7 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Data @Data
public class ReservoirareaInfoVO{ public class ReservoirareaInfoVO{
@ -51,28 +51,14 @@ public class ReservoirareaInfoVO{
@JsonProperty("warehouseId") @JsonProperty("warehouseId")
private String warehouseId; private String warehouseId;
/** 组织 **/
@JsonProperty("orgnizeId")
private String orgnizeId;
/** 部门 **/
@JsonProperty("departmentId")
private String departmentId;
/** 创建时间 **/ /** 创建时间 **/
@JsonProperty("creatortime") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Long creatortime; @JsonProperty("creatorTime")
private Date creatorTime;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
/** 修改时间 **/ /** 修改时间 **/
@JsonProperty("lastmodifytime") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Long lastmodifytime; @JsonProperty("lastModifyTime")
private Date lastModifyTime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
} }

@ -10,7 +10,7 @@ import java.util.List;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Data @Data
public class ReservoirareaListQuery extends Pagination { public class ReservoirareaListQuery extends Pagination {

@ -15,7 +15,7 @@ import java.math.BigDecimal;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Data @Data
public class ReservoirareaListVO{ public class ReservoirareaListVO{
@ -56,36 +56,16 @@ public class ReservoirareaListVO{
private String warehouseId; private String warehouseId;
/** 组织 **/
@JsonProperty("orgnizeId")
private String orgnizeId;
/** 部门 **/
@JsonProperty("departmentId")
private String departmentId;
/** 创建时间 **/ /** 创建时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatortime") @JsonProperty("creatorTime")
private Date creatortime; private Date creatorTime;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
/** 修改时间 **/ /** 修改时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("lastmodifytime") @JsonProperty("lastModifyTime")
private Date lastmodifytime; private Date lastModifyTime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
} }

@ -11,7 +11,7 @@ import java.util.List;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Data @Data
public class ReservoirareaPagination extends Pagination { public class ReservoirareaPagination extends Pagination {

@ -9,7 +9,7 @@ import java.util.*;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Data @Data
public class ReservoirareaPaginationExportModel extends Pagination { public class ReservoirareaPaginationExportModel extends Pagination {

@ -15,7 +15,7 @@ import lombok.Data;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Data @Data
public class ReservoirareaUpForm{ public class ReservoirareaUpForm{
@ -58,34 +58,14 @@ public class ReservoirareaUpForm{
private String warehouseId; private String warehouseId;
/** 组织 **/
@JsonProperty("orgnizeId")
private String orgnizeId;
/** 部门 **/
@JsonProperty("departmentId")
private String departmentId;
/** 创建时间 **/ /** 创建时间 **/
@JsonProperty("creatortime") @JsonProperty("creatorTime")
private Long creatortime; private String creatorTime;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
/** 修改时间 **/ /** 修改时间 **/
@JsonProperty("lastmodifytime") @JsonProperty("lastModifyTime")
private Long lastmodifytime; private String lastModifyTime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
} }

@ -1,16 +1,17 @@
package jnpf.reservoirarea.service; package jnpf.reservoirarea.service;
import jnpf.reservoirarea.entity.ReservoirareaEntity;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.reservoirarea.entity.ReservoirareaEntity;
import jnpf.reservoirarea.model.reservoirarea.ReservoirareaPagination; import jnpf.reservoirarea.model.reservoirarea.ReservoirareaPagination;
import java.util.*;
import java.util.List;
/** /**
* *
* reservoirarea *
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-05 * 2023-02-13
*/ */
public interface ReservoirareaService extends IService<ReservoirareaEntity> { public interface ReservoirareaService extends IService<ReservoirareaEntity> {

@ -1,44 +1,34 @@
package jnpf.reservoirarea.service.impl; package jnpf.reservoirarea.service.impl;
import jnpf.reservoirarea.entity.*;
import jnpf.reservoirarea.mapper.ReservoirareaMapper;
import jnpf.reservoirarea.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.util.RandomUtil;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField;
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.permission.model.authorize.AuthorizeConditionModel; import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.permission.service.AuthorizeService;
import jnpf.reservoirarea.entity.ReservoirareaEntity;
import jnpf.reservoirarea.mapper.ReservoirareaMapper;
import jnpf.reservoirarea.model.reservoirarea.ReservoirareaPagination; import jnpf.reservoirarea.model.reservoirarea.ReservoirareaPagination;
import jnpf.reservoirarea.service.ReservoirareaService;
import jnpf.util.ServletUtil;
import jnpf.util.StringUtil;
import jnpf.util.UserProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import jnpf.permission.service.AuthorizeService;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField; import java.util.ArrayList;
import java.util.stream.Collectors; import java.util.List;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
/** /**
* *
* reservoirarea *
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-05 * 2023-02-13
*/ */
@Service @Service
public class ReservoirareaServiceImpl extends ServiceImpl<ReservoirareaMapper, ReservoirareaEntity> implements ReservoirareaService { public class ReservoirareaServiceImpl extends ServiceImpl<ReservoirareaMapper, ReservoirareaEntity> implements ReservoirareaService {
@ -103,7 +93,7 @@ public class ReservoirareaServiceImpl extends ServiceImpl<ReservoirareaMapper, R
} }
//排序 //排序
if(StringUtil.isEmpty(reservoirareaPagination.getSidx())){ if(StringUtil.isEmpty(reservoirareaPagination.getSidx())){
reservoirareaQueryWrapper.lambda().orderByDesc(ReservoirareaEntity::getId); reservoirareaQueryWrapper.lambda().orderByDesc(ReservoirareaEntity::getCreatorTime);
}else{ }else{
try { try {
String sidx = reservoirareaPagination.getSidx(); String sidx = reservoirareaPagination.getSidx();
@ -174,7 +164,7 @@ public class ReservoirareaServiceImpl extends ServiceImpl<ReservoirareaMapper, R
} }
//排序 //排序
if(StringUtil.isEmpty(reservoirareaPagination.getSidx())){ if(StringUtil.isEmpty(reservoirareaPagination.getSidx())){
reservoirareaQueryWrapper.lambda().orderByDesc(ReservoirareaEntity::getId); reservoirareaQueryWrapper.lambda().orderByDesc(ReservoirareaEntity::getCreatorTime);
}else{ }else{
try { try {
String sidx = reservoirareaPagination.getSidx(); String sidx = reservoirareaPagination.getSidx();

@ -1,64 +1,55 @@
package jnpf.warehouse.controller; package jnpf.warehouse.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; 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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import jnpf.base.ActionResult; import jnpf.base.ActionResult;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.UserInfo; import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO; import jnpf.base.vo.DownloadVO;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.exception.DataException; import jnpf.exception.DataException;
import org.springframework.transaction.annotation.Transactional;
import jnpf.base.entity.ProvinceEntity;
import jnpf.warehouse.model.warehouse.*;
import jnpf.warehouse.model.warehouse.WarehousePagination;
import jnpf.entity.*;
import jnpf.util.*; import jnpf.util.*;
import jnpf.base.util.*; import jnpf.util.enums.FileTypeEnum;
import jnpf.base.vo.ListVO; import jnpf.util.file.UploadUtil;
import jnpf.util.context.SpringContext; import jnpf.warehouse.entity.WareHouseEntity;
import cn.hutool.core.util.ObjectUtil; import jnpf.warehouse.model.warehouse.*;
import lombok.extern.slf4j.Slf4j; import jnpf.warehouse.service.WareHouseService;
import lombok.Cleanup; import lombok.Cleanup;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import jnpf.warehouse.entity.WarehouseEntity;
import jnpf.warehouse.service.WarehouseService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired; 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 javax.validation.Valid;
import java.io.FileNotFoundException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import jnpf.util.GeneraterSwapUtil; import java.util.ArrayList;
import java.util.*; import java.util.HashMap;
import java.util.List;
import jnpf.util.file.UploadUtil; import java.util.Map;
import jnpf.util.enums.FileTypeEnum;
/** /**
* *
* warehouse *
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Slf4j @Slf4j
@RestController @RestController
@Api(tags = "warehouse" , value = "warehouse") @Api(tags = "仓库管理" , value = "example")
@RequestMapping("/api/warehouse/Warehouse") @RequestMapping("/api/example/WareHouse")
public class WarehouseController { public class WareHouseController {
@Autowired @Autowired
private GeneraterSwapUtil generaterSwapUtil; private GeneraterSwapUtil generaterSwapUtil;
@ -70,7 +61,7 @@ public class WarehouseController {
private UserProvider userProvider; private UserProvider userProvider;
@Autowired @Autowired
private WarehouseService warehouseService; private WareHouseService wareHouseService;
@ -78,24 +69,31 @@ public class WarehouseController {
/** /**
* *
* *
* @param warehousePagination * @param wareHousePagination
* @return * @return
*/ */
@ApiOperation("列表")
@PostMapping("/getList") @PostMapping("/getList")
public ActionResult list(@RequestBody WarehousePagination warehousePagination)throws IOException{ public ActionResult list(@RequestBody WareHousePagination wareHousePagination)throws IOException{
List<WarehouseEntity> list= warehouseService.getList(warehousePagination); List<WareHouseEntity> list= wareHouseService.getList(wareHousePagination);
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(WarehouseEntity entity:list){ for(WareHouseEntity entity:list){
Map<String,Object> companyCodeMap = new HashMap<>();
entity.setCompanyCode(generaterSwapUtil.getPopupSelectValue("394016341591396805","F_Id","F_FullName",entity.getCompanyCode(),companyCodeMap));
Map<String,Object> sublibraryMap = new HashMap<>();
entity.setSublibrary(generaterSwapUtil.getPopupSelectValue("394818245032483845","id","inventory_org_detail_name",entity.getSublibrary(),sublibraryMap));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
entity.setLastModifyUserName(generaterSwapUtil.userSelectValue(entity.getLastModifyUserName()));
// entity.setOrgId(generaterSwapUtil.comSelectValue(entity.getOrgId(), "all"));
// entity.setDepartmentId(generaterSwapUtil.posSelectValue(entity.getDepartmentId()));
} }
List<WarehouseListVO> listVO=JsonUtil.getJsonToList(list,WarehouseListVO.class); List<WareHouseListVO> listVO=JsonUtil.getJsonToList(list,WareHouseListVO.class);
for(WarehouseListVO warehouseVO:listVO){ for(WareHouseListVO wareHouseVO:listVO){
} }
PageListVO vo=new PageListVO(); PageListVO vo=new PageListVO();
vo.setList(listVO); vo.setList(listVO);
PaginationVO page=JsonUtil.getJsonToBean(warehousePagination,PaginationVO.class); PaginationVO page=JsonUtil.getJsonToBean(wareHousePagination,PaginationVO.class);
vo.setPagination(page); vo.setPagination(page);
return ActionResult.success(vo); return ActionResult.success(vo);
} }
@ -104,17 +102,23 @@ public class WarehouseController {
/** /**
* *
* *
* @param warehouseCrForm * @param wareHouseCrForm
* @return * @return
*/ */
@PostMapping @PostMapping
@Transactional @Transactional
public ActionResult create(@RequestBody @Valid WarehouseCrForm warehouseCrForm) throws DataException { public ActionResult create(@RequestBody @Valid WareHouseCrForm wareHouseCrForm) throws DataException {
String mainId =RandomUtil.uuId(); String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
WarehouseEntity entity = JsonUtil.getJsonToBean(warehouseCrForm, WarehouseEntity.class); wareHouseCrForm.setCreatorUserName(userInfo.getUserId());
wareHouseCrForm.setCreatorTime(DateUtil.getNow());
wareHouseCrForm.setOrgId(StringUtil.isEmpty(userInfo.getDepartmentId()) ? userInfo.getOrganizeId() : userInfo.getDepartmentId());
if(userInfo.getPositionIds()!=null&&userInfo.getPositionIds().length>0){
wareHouseCrForm.setDepartmentId(userInfo.getPositionIds()[0]);
}
WareHouseEntity entity = JsonUtil.getJsonToBean(wareHouseCrForm, WareHouseEntity.class);
entity.setId(mainId); entity.setId(mainId);
warehouseService.save(entity); wareHouseService.save(entity);
return ActionResult.success("创建成功"); return ActionResult.success("创建成功");
@ -147,22 +151,30 @@ public class WarehouseController {
*/ */
@ApiOperation("导出Excel") @ApiOperation("导出Excel")
@GetMapping("/Actions/Export") @GetMapping("/Actions/Export")
public ActionResult Export(WarehousePaginationExportModel warehousePaginationExportModel) throws IOException { public ActionResult Export(WareHousePaginationExportModel wareHousePaginationExportModel) throws IOException {
if (StringUtil.isEmpty(warehousePaginationExportModel.getSelectKey())){ if (StringUtil.isEmpty(wareHousePaginationExportModel.getSelectKey())){
return ActionResult.fail("请选择导出字段"); return ActionResult.fail("请选择导出字段");
} }
WarehousePagination warehousePagination=JsonUtil.getJsonToBean(warehousePaginationExportModel, WarehousePagination.class); WareHousePagination wareHousePagination=JsonUtil.getJsonToBean(wareHousePaginationExportModel, WareHousePagination.class);
List<WarehouseEntity> list= warehouseService.getTypeList(warehousePagination,warehousePaginationExportModel.getDataType()); List<WareHouseEntity> list= wareHouseService.getTypeList(wareHousePagination,wareHousePaginationExportModel.getDataType());
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(WarehouseEntity entity:list){ for(WareHouseEntity entity:list){
Map<String,Object> companyCodeMap = new HashMap<>();
entity.setCompanyCode(generaterSwapUtil.getPopupSelectValue("394016341591396805","F_Id","F_FullName",entity.getCompanyCode(),companyCodeMap));
Map<String,Object> sublibraryMap = new HashMap<>();
entity.setSublibrary(generaterSwapUtil.getPopupSelectValue("394818245032483845","id","inventory_org_detail_name",entity.getSublibrary(),sublibraryMap));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
entity.setLastModifyUserName(generaterSwapUtil.userSelectValue(entity.getLastModifyUserName()));
entity.setOrgId(generaterSwapUtil.comSelectValue(entity.getOrgId(), "all"));
entity.setDepartmentId(generaterSwapUtil.posSelectValue(entity.getDepartmentId()));
} }
List<WarehouseListVO> listVO=JsonUtil.getJsonToList(list,WarehouseListVO.class); List<WareHouseListVO> listVO=JsonUtil.getJsonToList(list,WareHouseListVO.class);
for(WarehouseListVO warehouseVO:listVO){ for(WareHouseListVO wareHouseVO:listVO){
} }
//转换为map输出 //转换为map输出
List<Map<String, Object>>mapList=JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringDateFormat(listVO,"yyyy-MM-dd HH:mm:ss")); List<Map<String, Object>>mapList=JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringDateFormat(listVO,"yyyy-MM-dd HH:mm:ss"));
String[]keys=!StringUtil.isEmpty(warehousePaginationExportModel.getSelectKey())?warehousePaginationExportModel.getSelectKey().split(","):new String[0]; String[]keys=!StringUtil.isEmpty(wareHousePaginationExportModel.getSelectKey())?wareHousePaginationExportModel.getSelectKey().split(","):new String[0];
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),mapList,keys,userInfo); DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),mapList,keys,userInfo);
return ActionResult.success(vo); return ActionResult.success(vo);
@ -177,11 +189,11 @@ public class WarehouseController {
case "code" : case "code" :
entitys.add(new ExcelExportEntity("仓库编码" ,"code")); entitys.add(new ExcelExportEntity("仓库编码" ,"code"));
break; break;
case "companyCode" : case "name" :
entitys.add(new ExcelExportEntity("公司代码" ,"companyCode")); entitys.add(new ExcelExportEntity("仓库名称" ,"name"));
break; break;
case "companyName" : case "companyCode" :
entitys.add(new ExcelExportEntity("公司名称" ,"companyName")); entitys.add(new ExcelExportEntity("公司" ,"companyCode"));
break; break;
case "location" : case "location" :
entitys.add(new ExcelExportEntity("仓库位置" ,"location")); entitys.add(new ExcelExportEntity("仓库位置" ,"location"));
@ -189,9 +201,6 @@ public class WarehouseController {
case "type" : case "type" :
entitys.add(new ExcelExportEntity("仓库类型" ,"type")); entitys.add(new ExcelExportEntity("仓库类型" ,"type"));
break; break;
case "organization" :
entitys.add(new ExcelExportEntity("ERP库存组织" ,"organization"));
break;
case "sublibrary" : case "sublibrary" :
entitys.add(new ExcelExportEntity("ERP子库" ,"sublibrary")); entitys.add(new ExcelExportEntity("ERP子库" ,"sublibrary"));
break; break;
@ -201,17 +210,23 @@ public class WarehouseController {
case "remark" : case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark")); entitys.add(new ExcelExportEntity("备注" ,"remark"));
break; break;
case "creatorusername" : case "creatorUserName" :
entitys.add(new ExcelExportEntity("创建人名称" ,"creatorusername")); entitys.add(new ExcelExportEntity("创建人名称" ,"creatorUserName"));
break;
case "creatorTime" :
entitys.add(new ExcelExportEntity("创建时间" ,"creatorTime"));
break; break;
case "creatortime" : case "lastModifyUserName" :
entitys.add(new ExcelExportEntity("创建时间" ,"creatortime")); entitys.add(new ExcelExportEntity("修改人名称" ,"lastModifyUserName"));
break; break;
case "lastmodifyusername" : case "lastModifyTime" :
entitys.add(new ExcelExportEntity("修改人名称" ,"lastmodifyusername")); entitys.add(new ExcelExportEntity("修改时间" ,"lastModifyTime"));
break; break;
case "lastmodifytime" : case "orgId" :
entitys.add(new ExcelExportEntity("修改时间" ,"lastmodifytime")); entitys.add(new ExcelExportEntity("组织ID" ,"orgId"));
break;
case "departmentId" :
entitys.add(new ExcelExportEntity("部门ID" ,"departmentId"));
break; break;
default: default:
break; break;
@ -273,9 +288,19 @@ public class WarehouseController {
* @return * @return
*/ */
@GetMapping("/{id}") @GetMapping("/{id}")
public ActionResult<WarehouseInfoVO> info(@PathVariable("id") String id){ public ActionResult<WareHouseInfoVO> info(@PathVariable("id") String id){
WarehouseEntity entity= warehouseService.getInfo(id); WareHouseEntity entity= wareHouseService.getInfo(id);
WarehouseInfoVO vo=JsonUtil.getJsonToBean(entity, WarehouseInfoVO.class); WareHouseInfoVO vo=JsonUtil.getJsonToBean(entity, WareHouseInfoVO.class);
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
if(vo.getCreatorTime()!=null){
vo.setCreatorTime(vo.getCreatorTime());
}
vo.setLastModifyUserName(generaterSwapUtil.userSelectValue(vo.getLastModifyUserName()));
if(vo.getLastModifyTime()!=null){
vo.setLastModifyTime(vo.getLastModifyTime());
}
// vo.setOrgId(generaterSwapUtil.comSelectValue(vo.getOrgId(), "all"));
// vo.setDepartmentId(generaterSwapUtil.posSelectValue(vo.getDepartmentId()));
//子表 //子表
//副表 //副表
@ -289,15 +314,23 @@ public class WarehouseController {
* @return * @return
*/ */
@GetMapping("/detail/{id}") @GetMapping("/detail/{id}")
public ActionResult<WarehouseInfoVO> detailInfo(@PathVariable("id") String id){ public ActionResult<WareHouseInfoVO> detailInfo(@PathVariable("id") String id){
WarehouseEntity entity= warehouseService.getInfo(id); WareHouseEntity entity= wareHouseService.getInfo(id);
WarehouseInfoVO vo=JsonUtil.getJsonToBean(entity, WarehouseInfoVO.class); WareHouseInfoVO vo=JsonUtil.getJsonToBean(entity, WareHouseInfoVO.class);
//子表数据转换 //子表数据转换
//附表数据转换 //附表数据转换
//添加到详情表单对象中 //添加到详情表单对象中
Map<String,Object> companyCodeMap = new HashMap<>();
vo.setCompanyCode(generaterSwapUtil.getPopupSelectValue("394016341591396805","F_Id","F_FullName",vo.getCompanyCode(),companyCodeMap));
Map<String,Object> sublibraryMap = new HashMap<>();
vo.setSublibrary(generaterSwapUtil.getPopupSelectValue("394818245032483845","id","inventory_org_detail_name",vo.getSublibrary(),sublibraryMap));
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
vo.setLastModifyUserName(generaterSwapUtil.userSelectValue(vo.getLastModifyUserName()));
vo.setOrgId(generaterSwapUtil.comSelectValue(vo.getOrgId(), "all"));
vo.setDepartmentId(generaterSwapUtil.posSelectValue(vo.getDepartmentId()));
return ActionResult.success(vo); return ActionResult.success(vo);
} }
@ -313,12 +346,18 @@ public class WarehouseController {
*/ */
@PutMapping("/{id}") @PutMapping("/{id}")
@Transactional @Transactional
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid WarehouseUpForm warehouseUpForm) throws DataException { public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid WareHouseUpForm wareHouseUpForm) throws DataException {
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
WarehouseEntity entity= warehouseService.getInfo(id); WareHouseEntity entity= wareHouseService.getInfo(id);
if(entity!=null){ if(entity!=null){
WarehouseEntity subentity=JsonUtil.getJsonToBean(warehouseUpForm, WarehouseEntity.class); wareHouseUpForm.setLastModifyUserName(userInfo.getUserId());
warehouseService.update(id, subentity); wareHouseUpForm.setLastModifyTime(DateUtil.getNow());
wareHouseUpForm.setOrgId(entity.getOrgId());
wareHouseUpForm.setDepartmentId(entity.getDepartmentId());
WareHouseEntity subentity=JsonUtil.getJsonToBean(wareHouseUpForm, WareHouseEntity.class);
subentity.setCreatorUserName(entity.getCreatorUserName());
subentity.setCreatorTime(entity.getCreatorTime());
wareHouseService.update(id, subentity);
return ActionResult.success("更新成功"); return ActionResult.success("更新成功");
}else{ }else{
return ActionResult.fail("更新失败,数据不存在"); return ActionResult.fail("更新失败,数据不存在");
@ -336,9 +375,9 @@ public class WarehouseController {
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@Transactional @Transactional
public ActionResult delete(@PathVariable("id") String id){ public ActionResult delete(@PathVariable("id") String id){
WarehouseEntity entity= warehouseService.getInfo(id); WareHouseEntity entity= wareHouseService.getInfo(id);
if(entity!=null){ if(entity!=null){
warehouseService.delete(entity); wareHouseService.delete(entity);
} }
return ActionResult.success("删除成功"); return ActionResult.success("删除成功");

@ -1,13 +1,11 @@
package jnpf.warehouse.entity; package jnpf.warehouse.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
@ -16,44 +14,44 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Data @Data
@TableName("jg_warehouse") @TableName("jg_warehouse")
public class WarehouseEntity { public class WareHouseEntity {
@TableId("ID") @TableId("ID")
private String id; private String id;
@TableField("CREATOR_USER_ID") @TableField("CREATOR_USER_ID")
private String creatoruserid; private String creatorUserId;
@TableField("CREATOR_USER_NAME") @TableField("CREATOR_USER_NAME")
private String creatorusername; private String creatorUserName;
@TableField("CREATOR_TIME") @TableField("CREATOR_TIME")
private Date creatortime; private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID") @TableField("LAST_MODIFY_USER_ID")
private String lastmodifyuserid; private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME") @TableField("LAST_MODIFY_USER_NAME")
private String lastmodifyusername; private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME") @TableField("LAST_MODIFY_TIME")
private Date lastmodifytime; private Date lastModifyTime;
@TableField("DELETE_USER_ID") @TableField("DELETE_USER_ID")
private String deleteuserid; private String deleteUserId;
@TableField("DELETE_USER_NAME") @TableField("DELETE_USER_NAME")
private String deleteusername; private String deleteUserName;
@TableField("DELETE_TIME") @TableField("DELETE_TIME")
private Date deletetime; private Date deleteTime;
@TableField("DELETE_MARK") @TableField("DELETE_MARK")
private String deletemark; private String deleteMark;
@TableField("ORG_ID") @TableField("ORG_ID")
private String orgId; private String orgId;
@ -70,15 +68,9 @@ public class WarehouseEntity {
@TableField("COMPANY_CODE") @TableField("COMPANY_CODE")
private String companyCode; private String companyCode;
@TableField("COMPANY_NAME")
private String companyName;
@TableField("TYPE") @TableField("TYPE")
private String type; private String type;
@TableField("ORGANIZATION")
private String organization;
@TableField("SUBLIBRARY") @TableField("SUBLIBRARY")
private String sublibrary; private String sublibrary;

@ -1,17 +1,17 @@
package jnpf.warehouse.mapper; package jnpf.warehouse.mapper;
import jnpf.warehouse.entity.WarehouseEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.warehouse.entity.WareHouseEntity;
/** /**
* *
* warehouse *
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-05 * 2023-02-13
*/ */
public interface WarehouseMapper extends BaseMapper<WarehouseEntity> { public interface WareHouseMapper extends BaseMapper<WareHouseEntity> {
} }

@ -14,23 +14,23 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Data @Data
public class WarehouseCrForm { public class WareHouseCrForm {
/** 仓库编码 **/ /** 仓库编码 **/
@JsonProperty("code") @JsonProperty("code")
private String code; private String code;
/** 公司代码 **/ /** 仓库名称 **/
@JsonProperty("name")
private String name;
/** 公司 **/
@JsonProperty("companyCode") @JsonProperty("companyCode")
private String companyCode; private String companyCode;
/** 公司名称 **/
@JsonProperty("companyName")
private String companyName;
/** 仓库位置 **/ /** 仓库位置 **/
@JsonProperty("location") @JsonProperty("location")
private String location; private String location;
@ -39,10 +39,6 @@ public class WarehouseCrForm {
@JsonProperty("type") @JsonProperty("type")
private String type; private String type;
/** ERP库存组织 **/
@JsonProperty("organization")
private String organization;
/** ERP子库 **/ /** ERP子库 **/
@JsonProperty("sublibrary") @JsonProperty("sublibrary")
private String sublibrary; private String sublibrary;
@ -56,20 +52,28 @@ public class WarehouseCrForm {
private String remark; private String remark;
/** 创建人名称 **/ /** 创建人名称 **/
@JsonProperty("creatorusername") @JsonProperty("creatorUserName")
private String creatorusername; private String creatorUserName;
/** 创建时间 **/ /** 创建时间 **/
@JsonProperty("creatortime") @JsonProperty("creatorTime")
private Long creatortime; private String creatorTime;
/** 修改人名称 **/ /** 修改人名称 **/
@JsonProperty("lastmodifyusername") @JsonProperty("lastModifyUserName")
private String lastmodifyusername; private String lastModifyUserName;
/** 修改时间 **/ /** 修改时间 **/
@JsonProperty("lastmodifytime") @JsonProperty("lastModifyTime")
private Long lastmodifytime; private String lastModifyTime;
/** 组织ID **/
@JsonProperty("orgId")
private String orgId;
/** 部门ID **/
@JsonProperty("departmentId")
private String departmentId;

@ -15,10 +15,10 @@ import com.fasterxml.jackson.annotation.JsonFormat;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Data @Data
public class WarehouseInfoVO{ public class WareHouseInfoVO{
/** 主键 **/ /** 主键 **/
@JsonProperty("id") @JsonProperty("id")
private String id; private String id;
@ -27,14 +27,14 @@ public class WarehouseInfoVO{
@JsonProperty("code") @JsonProperty("code")
private String code; private String code;
/** 公司代码 **/ /** 仓库名称 **/
@JsonProperty("name")
private String name;
/** 公司 **/
@JsonProperty("companyCode") @JsonProperty("companyCode")
private String companyCode; private String companyCode;
/** 公司名称 **/
@JsonProperty("companyName")
private String companyName;
/** 仓库位置 **/ /** 仓库位置 **/
@JsonProperty("location") @JsonProperty("location")
private String location; private String location;
@ -43,10 +43,6 @@ public class WarehouseInfoVO{
@JsonProperty("type") @JsonProperty("type")
private String type; private String type;
/** ERP库存组织 **/
@JsonProperty("organization")
private String organization;
/** ERP子库 **/ /** ERP子库 **/
@JsonProperty("sublibrary") @JsonProperty("sublibrary")
private String sublibrary; private String sublibrary;
@ -60,19 +56,29 @@ public class WarehouseInfoVO{
private String remark; private String remark;
/** 创建人名称 **/ /** 创建人名称 **/
@JsonProperty("creatorusername") @JsonProperty("creatorUserName")
private String creatorusername; private String creatorUserName;
/** 创建时间 **/ /** 创建时间 **/
@JsonProperty("creatortime") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Long creatortime; @JsonProperty("creatorTime")
private Date creatorTime;
/** 修改人名称 **/ /** 修改人名称 **/
@JsonProperty("lastmodifyusername") @JsonProperty("lastModifyUserName")
private String lastmodifyusername; private String lastModifyUserName;
/** 修改时间 **/ /** 修改时间 **/
@JsonProperty("lastmodifytime") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Long lastmodifytime; @JsonProperty("lastModifyTime")
private Date lastModifyTime;
/** 组织ID **/
@JsonProperty("orgId")
private String orgId;
/** 部门ID **/
@JsonProperty("departmentId")
private String departmentId;
} }

@ -10,16 +10,16 @@ import java.util.List;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Data @Data
public class WarehouseListQuery extends Pagination { public class WareHouseListQuery extends Pagination {
/** 激活状态 */
private String activestate;
/** 仓库编码 */ /** 仓库编码 */
private String code; private String code;
/** 仓库名称 */
private String name;
/** /**
* id * id
*/ */

@ -3,44 +3,39 @@
package jnpf.warehouse.model.warehouse; package jnpf.warehouse.model.warehouse;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal; import lombok.Data;
import java.util.Date;
/** /**
* *
* *
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Data @Data
public class WarehouseListVO{ public class WareHouseListVO{
/** 主键 */ /** 主键 */
private String id; private String id;
/*仓库名称 */
@JsonProperty("name")
private String name;
/** 仓库编码 **/ /** 仓库编码 **/
@JsonProperty("code") @JsonProperty("code")
private String code; private String code;
/** 公司代码 **/ /** 仓库名称 **/
@JsonProperty("companyCode") @JsonProperty("name")
private String companyCode; private String name;
/** 公司名称 **/ /** 公司 **/
@JsonProperty("companyName") @JsonProperty("companyCode")
private String companyName; private String companyCode;
/** 仓库位置 **/ /** 仓库位置 **/
@ -53,11 +48,6 @@ public class WarehouseListVO{
private String type; private String type;
/** ERP库存组织 **/
@JsonProperty("organization")
private String organization;
/** ERP子库 **/ /** ERP子库 **/
@JsonProperty("sublibrary") @JsonProperty("sublibrary")
private String sublibrary; private String sublibrary;
@ -74,25 +64,35 @@ public class WarehouseListVO{
/** 创建人名称 **/ /** 创建人名称 **/
@JsonProperty("creatorusername") @JsonProperty("creatorUserName")
private String creatorusername; private String creatorUserName;
/** 创建时间 **/ /** 创建时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatortime") @JsonProperty("creatorTime")
private Date creatortime; private Date creatorTime;
/** 修改人名称 **/ /** 修改人名称 **/
@JsonProperty("lastmodifyusername") @JsonProperty("lastModifyUserName")
private String lastmodifyusername; private String lastModifyUserName;
/** 修改时间 **/ /** 修改时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("lastmodifytime") @JsonProperty("lastModifyTime")
private Date lastmodifytime; private Date lastModifyTime;
/** 组织ID **/
@JsonProperty("orgId")
private String orgId;
/** 部门ID **/
@JsonProperty("departmentId")
private String departmentId;
} }

@ -11,16 +11,16 @@ import java.util.List;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Data @Data
public class WarehousePagination extends Pagination { public class WareHousePagination extends Pagination {
/** 激活状态 */
private String activestate;
/** 仓库编码 */ /** 仓库编码 */
private String code; private String code;
/** 仓库名称 */
private String name;
/** /**
* id * id
*/ */

@ -9,10 +9,10 @@ import java.util.*;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Data @Data
public class WarehousePaginationExportModel extends Pagination { public class WareHousePaginationExportModel extends Pagination {
private String selectKey; private String selectKey;
@ -21,9 +21,9 @@ public class WarehousePaginationExportModel extends Pagination {
private String dataType; private String dataType;
/** 激活状态 */
private String activestate;
/** 仓库编码 */ /** 仓库编码 */
private String code; private String code;
/** 仓库名称 */
private String name;
} }

@ -15,10 +15,10 @@ import lombok.Data;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-05 * @ 2023-02-13
*/ */
@Data @Data
public class WarehouseUpForm{ public class WareHouseUpForm{
/** 主键 */ /** 主键 */
private String id; private String id;
@ -28,14 +28,14 @@ public class WarehouseUpForm{
private String code; private String code;
/** 公司代码 **/ /** 仓库名称 **/
@JsonProperty("companyCode") @JsonProperty("name")
private String companyCode; private String name;
/** 公司名称 **/ /** 公司 **/
@JsonProperty("companyName") @JsonProperty("companyCode")
private String companyName; private String companyCode;
/** 仓库位置 **/ /** 仓库位置 **/
@ -48,11 +48,6 @@ public class WarehouseUpForm{
private String type; private String type;
/** ERP库存组织 **/
@JsonProperty("organization")
private String organization;
/** ERP子库 **/ /** ERP子库 **/
@JsonProperty("sublibrary") @JsonProperty("sublibrary")
private String sublibrary; private String sublibrary;
@ -69,23 +64,33 @@ public class WarehouseUpForm{
/** 创建人名称 **/ /** 创建人名称 **/
@JsonProperty("creatorusername") @JsonProperty("creatorUserName")
private String creatorusername; private String creatorUserName;
/** 创建时间 **/ /** 创建时间 **/
@JsonProperty("creatortime") @JsonProperty("creatorTime")
private Long creatortime; private String creatorTime;
/** 修改人名称 **/ /** 修改人名称 **/
@JsonProperty("lastmodifyusername") @JsonProperty("lastModifyUserName")
private String lastmodifyusername; private String lastModifyUserName;
/** 修改时间 **/ /** 修改时间 **/
@JsonProperty("lastmodifytime") @JsonProperty("lastModifyTime")
private Long lastmodifytime; private String lastModifyTime;
/** 组织ID **/
@JsonProperty("orgId")
private String orgId;
/** 部门ID **/
@JsonProperty("departmentId")
private String departmentId;
} }

@ -0,0 +1,35 @@
package jnpf.warehouse.service;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.warehouse.entity.WareHouseEntity;
import jnpf.warehouse.model.warehouse.WareHousePagination;
import java.util.List;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-13
*/
public interface WareHouseService extends IService<WareHouseEntity> {
List<WareHouseEntity> getList(WareHousePagination wareHousePagination);
List<WareHouseEntity> getTypeList(WareHousePagination wareHousePagination,String dataType);
WareHouseEntity getInfo(String id);
void delete(WareHouseEntity entity);
void create(WareHouseEntity entity);
boolean update( String id, WareHouseEntity entity);
// 子表方法
//列表子表数据方法
}

@ -1,34 +0,0 @@
package jnpf.warehouse.service;
import jnpf.warehouse.entity.WarehouseEntity;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.warehouse.model.warehouse.WarehousePagination;
import java.util.*;
/**
*
* warehouse
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
*/
public interface WarehouseService extends IService<WarehouseEntity> {
List<WarehouseEntity> getList(WarehousePagination warehousePagination);
List<WarehouseEntity> getTypeList(WarehousePagination warehousePagination,String dataType);
WarehouseEntity getInfo(String id);
void delete(WarehouseEntity entity);
void create(WarehouseEntity entity);
boolean update( String id, WarehouseEntity entity);
// 子表方法
//列表子表数据方法
}

@ -0,0 +1,222 @@
package jnpf.warehouse.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField;
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.permission.model.authorize.AuthorizeConditionModel;
import jnpf.permission.service.AuthorizeService;
import jnpf.util.ServletUtil;
import jnpf.util.StringUtil;
import jnpf.util.UserProvider;
import jnpf.warehouse.entity.WareHouseEntity;
import jnpf.warehouse.mapper.WareHouseMapper;
import jnpf.warehouse.model.warehouse.WareHousePagination;
import jnpf.warehouse.service.WareHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-13
*/
@Service
public class WareHouseServiceImpl extends ServiceImpl<WareHouseMapper, WareHouseEntity> implements WareHouseService {
@Autowired
private UserProvider userProvider;
@Autowired
private AuthorizeService authorizeService;
@Override
public List<WareHouseEntity> getList(WareHousePagination wareHousePagination){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int wareHouseNum =0;
QueryWrapper<WareHouseEntity> wareHouseQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object wareHouseObj=authorizeService.getCondition(new AuthorizeConditionModel(wareHouseQueryWrapper,wareHousePagination.getMenuId(),"wareHouse"));
if (ObjectUtil.isEmpty(wareHouseObj)){
return new ArrayList<>();
} else {
wareHouseQueryWrapper = (QueryWrapper<WareHouseEntity>)wareHouseObj;
wareHouseNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object wareHouseObj=authorizeService.getCondition(new AuthorizeConditionModel(wareHouseQueryWrapper,wareHousePagination.getMenuId(),"wareHouse"));
if (ObjectUtil.isEmpty(wareHouseObj)){
return new ArrayList<>();
} else {
wareHouseQueryWrapper = (QueryWrapper<WareHouseEntity>)wareHouseObj;
wareHouseNum++;
}
}
}
if(StringUtil.isNotEmpty(wareHousePagination.getCode())){
wareHouseNum++;
wareHouseQueryWrapper.lambda().like(WareHouseEntity::getCode,wareHousePagination.getCode());
}
if(StringUtil.isNotEmpty(wareHousePagination.getName())){
wareHouseNum++;
wareHouseQueryWrapper.lambda().like(WareHouseEntity::getName,wareHousePagination.getName());
}
if(AllIdList.size()>0){
wareHouseQueryWrapper.lambda().in(WareHouseEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(wareHousePagination.getSidx())){
wareHouseQueryWrapper.lambda().orderByDesc(WareHouseEntity::getCreatorTime);
}else{
try {
String sidx = wareHousePagination.getSidx();
WareHouseEntity wareHouseEntity = new WareHouseEntity();
Field declaredField = wareHouseEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
wareHouseQueryWrapper="asc".equals(wareHousePagination.getSort().toLowerCase())?wareHouseQueryWrapper.orderByAsc(value):wareHouseQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if((total>0 && AllIdList.size()>0) || total==0){
Page<WareHouseEntity> page=new Page<>(wareHousePagination.getCurrentPage(), wareHousePagination.getPageSize());
IPage<WareHouseEntity> userIPage=this.page(page, wareHouseQueryWrapper);
return wareHousePagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<WareHouseEntity> list = new ArrayList();
return wareHousePagination.setData(list, list.size());
}
}
@Override
public List<WareHouseEntity> getTypeList(WareHousePagination wareHousePagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int wareHouseNum =0;
QueryWrapper<WareHouseEntity> wareHouseQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object wareHouseObj=authorizeService.getCondition(new AuthorizeConditionModel(wareHouseQueryWrapper,wareHousePagination.getMenuId(),"wareHouse"));
if (ObjectUtil.isEmpty(wareHouseObj)){
return new ArrayList<>();
} else {
wareHouseQueryWrapper = (QueryWrapper<WareHouseEntity>)wareHouseObj;
wareHouseNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object wareHouseObj=authorizeService.getCondition(new AuthorizeConditionModel(wareHouseQueryWrapper,wareHousePagination.getMenuId(),"wareHouse"));
if (ObjectUtil.isEmpty(wareHouseObj)){
return new ArrayList<>();
} else {
wareHouseQueryWrapper = (QueryWrapper<WareHouseEntity>)wareHouseObj;
wareHouseNum++;
}
}
}
if(StringUtil.isNotEmpty(wareHousePagination.getCode())){
wareHouseNum++;
wareHouseQueryWrapper.lambda().like(WareHouseEntity::getCode,wareHousePagination.getCode());
}
if(StringUtil.isNotEmpty(wareHousePagination.getName())){
wareHouseNum++;
wareHouseQueryWrapper.lambda().like(WareHouseEntity::getName,wareHousePagination.getName());
}
if(AllIdList.size()>0){
wareHouseQueryWrapper.lambda().in(WareHouseEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(wareHousePagination.getSidx())){
wareHouseQueryWrapper.lambda().orderByDesc(WareHouseEntity::getCreatorTime);
}else{
try {
String sidx = wareHousePagination.getSidx();
WareHouseEntity wareHouseEntity = new WareHouseEntity();
Field declaredField = wareHouseEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
wareHouseQueryWrapper="asc".equals(wareHousePagination.getSort().toLowerCase())?wareHouseQueryWrapper.orderByAsc(value):wareHouseQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<WareHouseEntity> page=new Page<>(wareHousePagination.getCurrentPage(), wareHousePagination.getPageSize());
IPage<WareHouseEntity> userIPage=this.page(page, wareHouseQueryWrapper);
return wareHousePagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<WareHouseEntity> list = new ArrayList();
return wareHousePagination.setData(list, list.size());
}
}else{
return this.list(wareHouseQueryWrapper);
}
}
@Override
public WareHouseEntity getInfo(String id){
QueryWrapper<WareHouseEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(WareHouseEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(WareHouseEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, WareHouseEntity entity){
entity.setId(id);
return this.updateById(entity);
}
@Override
public void delete(WareHouseEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
//子表方法
//列表子表数据方法
}

@ -1,232 +0,0 @@
package jnpf.warehouse.service.impl;
import jnpf.warehouse.entity.*;
import jnpf.warehouse.mapper.WarehouseMapper;
import jnpf.warehouse.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.util.RandomUtil;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.warehouse.model.warehouse.WarehousePagination;
import jnpf.permission.service.AuthorizeService;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.stream.Collectors;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
/**
*
* warehouse
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
*/
@Service
public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper, WarehouseEntity> implements WarehouseService{
@Autowired
private UserProvider userProvider;
@Autowired
private AuthorizeService authorizeService;
@Override
public List<WarehouseEntity> getList(WarehousePagination warehousePagination){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int warehouseNum =0;
QueryWrapper<WarehouseEntity> warehouseQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object warehouseObj=authorizeService.getCondition(new AuthorizeConditionModel(warehouseQueryWrapper,warehousePagination.getMenuId(),"warehouse"));
if (ObjectUtil.isEmpty(warehouseObj)){
return new ArrayList<>();
} else {
warehouseQueryWrapper = (QueryWrapper<WarehouseEntity>)warehouseObj;
warehouseNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object warehouseObj=authorizeService.getCondition(new AuthorizeConditionModel(warehouseQueryWrapper,warehousePagination.getMenuId(),"warehouse"));
if (ObjectUtil.isEmpty(warehouseObj)){
return new ArrayList<>();
} else {
warehouseQueryWrapper = (QueryWrapper<WarehouseEntity>)warehouseObj;
warehouseNum++;
}
}
}
if(StringUtil.isNotEmpty(warehousePagination.getActivestate())){
warehouseNum++;
warehouseQueryWrapper.lambda().eq(WarehouseEntity::getActivestate,warehousePagination.getActivestate());
}
if(StringUtil.isNotEmpty(warehousePagination.getCode())){
warehouseNum++;
warehouseQueryWrapper.lambda().like(WarehouseEntity::getCode,warehousePagination.getCode());
}
if(AllIdList.size()>0){
warehouseQueryWrapper.lambda().in(WarehouseEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(warehousePagination.getSidx())){
warehouseQueryWrapper.lambda().orderByDesc(WarehouseEntity::getId);
}else{
try {
String sidx = warehousePagination.getSidx();
WarehouseEntity warehouseEntity = new WarehouseEntity();
Field declaredField = warehouseEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
warehouseQueryWrapper="asc".equals(warehousePagination.getSort().toLowerCase())?warehouseQueryWrapper.orderByAsc(value):warehouseQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if((total>0 && AllIdList.size()>0) || total==0){
Page<WarehouseEntity> page=new Page<>(warehousePagination.getCurrentPage(), warehousePagination.getPageSize());
IPage<WarehouseEntity> userIPage=this.page(page, warehouseQueryWrapper);
return warehousePagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<WarehouseEntity> list = new ArrayList();
return warehousePagination.setData(list, list.size());
}
}
@Override
public List<WarehouseEntity> getTypeList(WarehousePagination warehousePagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int warehouseNum =0;
QueryWrapper<WarehouseEntity> warehouseQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object warehouseObj=authorizeService.getCondition(new AuthorizeConditionModel(warehouseQueryWrapper,warehousePagination.getMenuId(),"warehouse"));
if (ObjectUtil.isEmpty(warehouseObj)){
return new ArrayList<>();
} else {
warehouseQueryWrapper = (QueryWrapper<WarehouseEntity>)warehouseObj;
warehouseNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object warehouseObj=authorizeService.getCondition(new AuthorizeConditionModel(warehouseQueryWrapper,warehousePagination.getMenuId(),"warehouse"));
if (ObjectUtil.isEmpty(warehouseObj)){
return new ArrayList<>();
} else {
warehouseQueryWrapper = (QueryWrapper<WarehouseEntity>)warehouseObj;
warehouseNum++;
}
}
}
if(StringUtil.isNotEmpty(warehousePagination.getActivestate())){
warehouseNum++;
warehouseQueryWrapper.lambda().eq(WarehouseEntity::getActivestate,warehousePagination.getActivestate());
}
if(StringUtil.isNotEmpty(warehousePagination.getCode())){
warehouseNum++;
warehouseQueryWrapper.lambda().like(WarehouseEntity::getCode,warehousePagination.getCode());
}
if(AllIdList.size()>0){
warehouseQueryWrapper.lambda().in(WarehouseEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(warehousePagination.getSidx())){
warehouseQueryWrapper.lambda().orderByDesc(WarehouseEntity::getId);
}else{
try {
String sidx = warehousePagination.getSidx();
WarehouseEntity warehouseEntity = new WarehouseEntity();
Field declaredField = warehouseEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
warehouseQueryWrapper="asc".equals(warehousePagination.getSort().toLowerCase())?warehouseQueryWrapper.orderByAsc(value):warehouseQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<WarehouseEntity> page=new Page<>(warehousePagination.getCurrentPage(), warehousePagination.getPageSize());
IPage<WarehouseEntity> userIPage=this.page(page, warehouseQueryWrapper);
return warehousePagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<WarehouseEntity> list = new ArrayList();
return warehousePagination.setData(list, list.size());
}
}else{
return this.list(warehouseQueryWrapper);
}
}
@Override
public WarehouseEntity getInfo(String id){
QueryWrapper<WarehouseEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(WarehouseEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(WarehouseEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, WarehouseEntity entity){
entity.setId(id);
return this.updateById(entity);
}
@Override
public void delete(WarehouseEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
//子表方法
//列表子表数据方法
}

@ -0,0 +1,7 @@
<?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.reservoirarea.mapper.ReservoirareaMapper">
</mapper>

@ -0,0 +1,7 @@
<?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.warehouse.mapper.WareHouseMapper">
</mapper>

@ -48,42 +48,6 @@
<p>{{dataForm.warehouseId}}</p> <p>{{dataForm.warehouseId}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" >
<el-form-item label="组织"
prop="orgnizeId" >
<p>{{dataForm.orgnizeId}}</p>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="部门"
prop="departmentId" >
<p>{{dataForm.departmentId}}</p>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="创建时间"
prop="creatortime" >
<p>{{jnpf.dateFormat(dataForm.creatortime)}}</p>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="创建人名称"
prop="creatorusername" >
<p>{{dataForm.creatorusername}}</p>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="修改时间"
prop="lastmodifytime" >
<p>{{jnpf.dateFormat(dataForm.lastmodifytime)}}</p>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="修改人名称"
prop="lastmodifyusername" >
<p>{{dataForm.lastmodifyusername}}</p>
</el-form-item>
</el-col>
</template> </template>
</el-form> </el-form>
</el-row> </el-row>
@ -114,12 +78,8 @@
minimum : 1, minimum : 1,
unit : "", unit : "",
warehouseId : "", warehouseId : "",
orgnizeId : '', creatorTime : "",
departmentId : '', lastModifyTime : "",
creatortime : '',
creatorusername : '',
lastmodifytime : '',
lastmodifyusername : '',
}, },
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}], unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
@ -144,7 +104,7 @@
if(this.dataForm.id){ if(this.dataForm.id){
this.loading = true this.loading = true
request({ request({
url: '/api/reservoirarea/Reservoirarea/detail/'+this.dataForm.id, url: '/api/example/Reservoirarea/detail/'+this.dataForm.id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)

@ -1,112 +1,77 @@
<template> <template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body <el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px"> :close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class=""> <el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" <el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
label-position="right">
<template v-if="!loading"> <template v-if="!loading">
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="库区编码" prop="areacode"> <el-form-item label="库区编码"
<el-input v-model="dataForm.areacode" placeholder="请输入" clearable :style='{"width":"100%"}'> prop="areacode" >
<el-input v-model="dataForm.areacode"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="库区名称" prop="areaname"> <el-form-item label="库区名称"
<el-input v-model="dataForm.areaname" placeholder="请输入" clearable :style='{"width":"100%"}'> prop="areaname" >
<el-input v-model="dataForm.areaname"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="最高库存" prop="maximum"> <el-form-item label="最高库存"
<el-input-number v-model="dataForm.maximum" placeholder="数字文本" :step="1"> prop="maximum" >
<el-input-number v-model="dataForm.maximum"
placeholder="数字文本" :step="1" >
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="安全库存" prop="safety"> <el-form-item label="安全库存"
<el-input-number v-model="dataForm.safety" placeholder="数字文本" :step="1"> prop="safety" >
<el-input-number v-model="dataForm.safety"
placeholder="数字文本" :step="1" >
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="最低库存" prop="minimum"> <el-form-item label="最低库存"
<el-input-number v-model="dataForm.minimum" placeholder="数字文本" :step="1"> prop="minimum" >
<el-input-number v-model="dataForm.minimum"
placeholder="数字文本" :step="1" >
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="计量单位" prop="unit"> <el-form-item label="计量单位"
<el-select v-model="dataForm.unit" placeholder="请选择" clearable :style='{"width":"100%"}'> prop="unit" >
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" <el-select v-model="dataForm.unit"
:value="item.id" :disabled="item.disabled"></el-option> placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="仓库" prop="warehouseId"> <el-form-item label="仓库"
<popupSelect v-model="dataForm.warehouseId" placeholder="请选择" clearable field="warehouseId" prop="warehouseId" >
interfaceId="380988259175524165" :columnOptions="warehouseIdcolumnOptions" <popupSelect v-model="dataForm.warehouseId"
propsValue="id" relationField="name" popupType="dialog" popupTitle="选择数据" placeholder="请选择" field="warehouseId" interfaceId="394860934465658373" :columnOptions="warehouseIdcolumnOptions" propsValue="id" relationField="NAME" popupType="dialog"
popupWidth="800px"> popupTitle="选择数据" popupWidth="800px"
>
</popupSelect> </popupSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24">
<el-form-item label="组织" prop="orgnizeId">
<com-select v-model="dataForm.orgnizeId" placeholder="请选择" clearable>
</com-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="部门" prop="departmentId">
<dep-select v-model="dataForm.departmentId" placeholder="请选择" clearable>
</dep-select>
</el-form-item>
</el-col>
<el-col :span="24">
<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="24">
<el-form-item label="创建人名称" prop="creatorusername">
<el-input v-model="dataForm.creatorusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<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="24">
<el-form-item label="修改人名称" prop="lastmodifyusername">
<el-input v-model="dataForm.lastmodifyusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
</template> </template>
</el-form> </el-form>
</el-row> </el-row>
@ -118,12 +83,8 @@
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import { import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
getDataInterfaceRes import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
export default { export default {
components: {}, components: {},
props: [], props: [],
@ -140,43 +101,28 @@
minimum : 1, minimum : 1,
unit : "", unit : "",
warehouseId : "", warehouseId : "",
orgnizeId: '', creatorTime : "",
departmentId: '', lastModifyTime : "",
creatortime: '',
creatorusername: '',
lastmodifytime: '',
lastmodifyusername: '',
}, },
rules: { rules:
areacode: [{ {
warehouseId: [
{
required: true, required: true,
message: '请输入', message: '请选择',
trigger: 'blur' trigger: 'change'
}, ],
}, },
unitOptions: [{ ],
"fullName": "吨", },
"id": "0" unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
}, { warehouseIdcolumnOptions:[ {"label":"仓库名称","value":"NAME"}, {"label":"ERP库存组织名称","value":"inventory_org_name"}, {"label":"ERP库存组织详情名称","value":"inventory_org_detail_name"},],
"fullName": "千克",
"id": "1"
}],
warehouseIdcolumnOptions: [{
"label": "ID",
"value": "id"
}, {
"label": "仓库号",
"value": "code"
}, {
"label": "仓库名称",
"value": "name"
}, ],
} }
}, },
computed: {}, computed: {},
watch: {}, watch: {},
created() {}, created() {
},
mounted() {}, mounted() {},
methods: { methods: {
clearData(data){ clearData(data){
@ -199,7 +145,7 @@
if(this.dataForm.id){ if(this.dataForm.id){
this.loading = true this.loading = true
request({ request({
url: '/api/reservoirarea/Reservoirarea/' + this.dataForm.id, url: '/api/example/Reservoirarea/'+this.dataForm.id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
@ -223,7 +169,7 @@
var _data =this.dataList() var _data =this.dataList()
if (!this.dataForm.id) { if (!this.dataForm.id) {
request({ request({
url: '/api/reservoirarea/Reservoirarea', url: '/api/example/Reservoirarea',
method: 'post', method: 'post',
data: _data data: _data
}).then((res) => { }).then((res) => {
@ -239,7 +185,7 @@
}) })
}else{ }else{
request({ request({
url: '/api/reservoirarea/Reservoirarea/' + this.dataForm.id, url: '/api/example/Reservoirarea/'+this.dataForm.id,
method: 'PUT', method: 'PUT',
data: _data data: _data
}).then((res) => { }).then((res) => {
@ -257,14 +203,13 @@
}, },
dataList(){ dataList(){
var _data = JSON.parse(JSON.stringify(this.dataForm)); var _data = JSON.parse(JSON.stringify(this.dataForm));
_data.orgnizeId = JSON.stringify(_data.orgnizeId)
return _data; return _data;
}, },
dataInfo(dataAll){ dataInfo(dataAll){
let _dataAll =dataAll let _dataAll =dataAll
_dataAll.orgnizeId = JSON.parse(_dataAll.orgnizeId)
this.dataForm = _dataAll this.dataForm = _dataAll
}, },
}, },
} }
</script> </script>

@ -40,36 +40,37 @@
<screenfull isContainer/> <screenfull isContainer/>
</div> </div>
</div> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
@selection-change="handleSelectionChange"> <el-table-column prop="areacode" label="库区编码" width="0" align="left"
<el-table-column prop="areacode" label="库区编码" width="0" align="left" /> />
<el-table-column prop="areaname" label="库区名称" width="0" align="left" /> <el-table-column prop="areaname" label="库区名称" width="0" align="left"
<el-table-column prop="maximum" label="最高库存" width="0" align="left" /> />
<el-table-column prop="safety" label="安全库存" width="0" align="left" /> <el-table-column prop="maximum" label="最高库存" width="0" align="left"
<el-table-column prop="minimum" label="最低库存" width="0" align="left" /> />
<el-table-column label="计量单位" width="0" prop="unit" algin="left"> <el-table-column prop="safety" label="安全库存" width="0" align="left"
/>
<el-table-column prop="minimum" label="最低库存" width="0" align="left"
/>
<el-table-column label="计量单位" width="0" prop="unit" algin="left"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.unit | dynamicText(unitOptions) }} {{ scope.row.unit | dynamicText(unitOptions) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="warehouseId" label="仓库" width="0" align="left" /> <el-table-column prop="warehouseId" label="仓库" width="0" align="left"
<el-table-column prop="orgnizeId" label="组织" width="0" align="left" /> />
<el-table-column prop="departmentId" label="部门" width="0" align="left" /> <el-table-column label="操作" fixed="right"
<el-table-column prop="creatortime" label="创建时间" width="0" align="left" /> width="100" >
<el-table-column prop="creatorusername" label="创建人名称" width="0" align="left" />
<el-table-column prop="lastmodifytime" label="修改时间" width="0" align="left" />
<el-table-column prop="lastmodifyusername" label="修改人名称" width="0" align="left" />
<el-table-column label="操作" fixed="right" width="100">
<template slot-scope="scope"> <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>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)"> <el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</JNPF-table> </JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
@pagination="initData" />
</div> </div>
</div> </div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/> <JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
@ -80,22 +81,14 @@
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import { import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import JNPFForm from './Form' import JNPFForm from './Form'
import ExportBox from './ExportBox' import ExportBox from './ExportBox'
import { import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import Detail from './Detail' import Detail from './Detail'
export default { export default {
components: { components: {JNPFForm, ExportBox,Detail},
JNPFForm,
ExportBox,
Detail
},
data() { data() {
return { return {
detailVisible: false, detailVisible: false,
@ -110,80 +103,26 @@
}, },
list: [], list: [],
listLoading: true, listLoading: true,
multipleSelection: [], multipleSelection: [], total: 0,
total: 0,
listQuery: { listQuery: {
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
sort: "desc", sort: "desc",
sidx: "", sidx: "creatorTime",
}, },
formVisible: false, formVisible: false,
exportBoxVisible: false, exportBoxVisible: false,
columnList: [{ columnList: [
prop: 'areacode', {prop: 'areacode', label: '库区编码'},
label: '库区编码' {prop: 'areaname', label: '库区名称'},
}, {prop: 'maximum', label: '最高库存'},
{ {prop: 'safety', label: '安全库存'},
prop: 'areaname', {prop: 'minimum', label: '最低库存'},
label: '库区名称' {prop: 'unit', label: '计量单位'},
}, {prop: 'warehouseId', label: '仓库'},
{
prop: 'maximum',
label: '最高库存'
},
{
prop: 'safety',
label: '安全库存'
},
{
prop: 'minimum',
label: '最低库存'
},
{
prop: 'unit',
label: '计量单位'
},
{
prop: 'warehouseId',
label: '仓库'
},
{
prop: 'orgnizeId',
label: '组织'
},
{
prop: 'departmentId',
label: '部门'
},
{
prop: 'creatortime',
label: '创建时间'
},
{
prop: 'creatorusername',
label: '创建人名称'
},
{
prop: 'lastmodifytime',
label: '修改时间'
},
{
prop: 'lastmodifyusername',
label: '修改人名称'
},
], ],
unitOptions: [{ unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
"fullName": "吨", unitProps:{"label":"fullName","value":"id"},
"id": "0"
}, {
"fullName": "千克",
"id": "1"
}],
unitProps: {
"label": "fullName",
"value": "id"
},
} }
}, },
computed: { computed: {
@ -201,11 +140,7 @@
this.$refs.Detail.init(id) this.$refs.Detail.init(id)
}) })
}, },
sortChange({ sortChange({column, prop, order}) {
column,
prop,
order
}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc' this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop this.listQuery.sidx = !order ? '' : prop
this.initData() this.initData()
@ -218,7 +153,7 @@
menuId:this.menuId menuId:this.menuId
}; };
request({ request({
url: `/api/reservoirarea/Reservoirarea/getList`, url: `/api/example/Reservoirarea/getList`,
method: 'post', method: 'post',
data: _query data: _query
}).then(res => { }).then(res => {
@ -238,7 +173,7 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
request({ request({
url: `/api/reservoirarea/Reservoirarea/${id}`, url: `/api/example/Reservoirarea/${id}`,
method: 'DELETE' method: 'DELETE'
}).then(res => { }).then(res => {
this.$message({ this.$message({
@ -249,7 +184,8 @@
} }
}); });
}) })
}).catch(() => {}); }).catch(() => {
});
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
const res = val.map(item => item.id) const res = val.map(item => item.id)
@ -269,7 +205,7 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
request({ request({
url: `/api/reservoirarea/Reservoirarea/batchRemove/${ids}`, url: `/api/example/Reservoirarea/batchRemove/${ids}`,
method: 'DELETE' method: 'DELETE'
}).then(res => { }).then(res => {
this.$message({ this.$message({
@ -280,7 +216,8 @@
} }
}); });
}) })
}).catch(() => {}) }).catch(() => {
})
}, },
addOrUpdateHandle(id, isDetail) { addOrUpdateHandle(id, isDetail) {
this.formVisible = true this.formVisible = true
@ -295,14 +232,9 @@
}) })
}, },
download(data) { download(data) {
let query = { let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
...data,
...this.listQuery,
...this.query,
menuId: this.menuId
}
request({ request({
url: `/api/reservoirarea/Reservoirarea/Actions/Export`, url: `/api/example/Reservoirarea/Actions/Export`,
method: 'GET', method: 'GET',
data: query data: query
}).then(res => { }).then(res => {
@ -317,7 +249,7 @@
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
sort: "desc", sort: "desc",
sidx: "", sidx: "creatorTime",
} }
this.initData() this.initData()
}, },

@ -13,15 +13,15 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="公司代码" <el-form-item label="仓库名称"
prop="companyCode" > prop="name" >
<p>{{dataForm.companyCode}}</p> <p>{{dataForm.name}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="公司名称" <el-form-item label="公司"
prop="companyName" > prop="companyCode" >
<p>{{dataForm.companyName}}</p> <p>{{dataForm.companyCode}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
@ -36,16 +36,10 @@
<p>{{ dataForm.type | dynamicText(typeOptions) }} </p> <p>{{ dataForm.type | dynamicText(typeOptions) }} </p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" >
<el-form-item label="ERP库存组织"
prop="organization" >
<p>{{ dataForm.organization | dynamicText(organizationOptions) }} </p>
</el-form-item>
</el-col>
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="ERP子库" <el-form-item label="ERP子库"
prop="sublibrary" > prop="sublibrary" >
<p>{{ dataForm.sublibrary | dynamicText(sublibraryOptions) }} </p> <p>{{dataForm.sublibrary}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
@ -60,30 +54,6 @@
<p>{{dataForm.remark}}</p> <p>{{dataForm.remark}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" >
<el-form-item label="创建人名称"
prop="creatorusername" >
<p>{{dataForm.creatorusername}}</p>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="创建时间"
prop="creatortime" >
<p>{{jnpf.dateFormat(dataForm.creatortime)}}</p>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="修改人名称"
prop="lastmodifyusername" >
<p>{{dataForm.lastmodifyusername}}</p>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="修改时间"
prop="lastmodifytime" >
<p>{{jnpf.dateFormat(dataForm.lastmodifytime)}}</p>
</el-form-item>
</el-col>
</template> </template>
</el-form> </el-form>
</el-row> </el-row>
@ -108,22 +78,21 @@
dataForm: { dataForm: {
id :'', id :'',
code : '', code : '',
companyCode : '', name : '',
companyName : '', companyCode : "",
location : '', location : '',
type : "", type : "",
organization : "",
sublibrary : "", sublibrary : "",
activestate : "2", activestate : "2",
remark : '', remark : '',
creatorusername : '', creatorUserName : "",
creatortime : '', creatorTime : "",
lastmodifyusername : '', lastModifyUserName : "",
lastmodifytime : '', lastModifyTime : "",
orgId : "",
departmentId : "",
}, },
typeOptions:[{"fullName":"原料库","id":"0"},{"fullName":"中间库","id":"1"},{"fullName":"成品库","id":"2"},{"fullName":"副产品库","id":"3"},{"fullName":"废次品库","id":"4"},{"fullName":"备件辅材库","id":"5"},{"fullName":"贸易虚拟库","id":"6"},{"fullName":"仓储库","id":"7"},{"fullName":"能源库","id":"8"},{"fullName":"其他库","id":"9"},{"fullName":"帐外库","id":"10"}], typeOptions:[{"fullName":"原料库","id":"0"},{"fullName":"中间库","id":"1"},{"fullName":"成品库","id":"2"},{"fullName":"副产品库","id":"3"},{"fullName":"废次品库","id":"4"},{"fullName":"备件辅材库","id":"5"},{"fullName":"贸易虚拟库","id":"6"},{"fullName":"仓储库","id":"7"},{"fullName":"能源库","id":"8"},{"fullName":"其他库","id":"9"},{"fullName":"帐外库","id":"10"}],
organizationOptions:[{"fullName":"济钢集团","id":"0"},{"fullName":"日照","id":"1"}],
sublibraryOptions:[{"fullName":"城市矿产钢材库","id":"0"},{"fullName":"黄河爆破待发库","id":"1"},{"fullName":"黄河爆破完工库","id":"2"}],
activestateOptions:[{"fullName":"激活","id":"1"},{"fullName":"未激活","id":"0"}], activestateOptions:[{"fullName":"激活","id":"1"},{"fullName":"未激活","id":"0"}],
} }
@ -147,7 +116,7 @@
if(this.dataForm.id){ if(this.dataForm.id){
this.loading = true this.loading = true
request({ request({
url: '/api/warehouse/Warehouse/detail/'+this.dataForm.id, url: '/api/example/WareHouse/detail/'+this.dataForm.id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)

@ -1,124 +1,91 @@
<template> <template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body <el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px"> :close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="800px">
<el-row :gutter="15" class=""> <el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="150px" <el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
label-position="right">
<template v-if="!loading"> <template v-if="!loading">
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="仓库编码" prop="code"> <el-form-item label="仓库编码"
<el-input v-model="dataForm.code" placeholder="请输入" clearable :style='{"width":"100%"}'> prop="code" >
<el-input v-model="dataForm.code"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="公司代码" prop="companyCode"> <el-form-item label="仓库名称"
<el-input v-model="dataForm.companyCode" placeholder="请输入" clearable prop="name" >
:style='{"width":"100%"}'> <el-input v-model="dataForm.name"
placeholder="请输入仓库名称" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="公司名称" prop="companyName"> <el-form-item label="公司"
<el-input v-model="dataForm.companyName" placeholder="请输入" clearable prop="companyCode" >
:style='{"width":"100%"}'> <popupSelect v-model="dataForm.companyCode"
placeholder="请选择公司" clearable field="companyCode" interfaceId="394016341591396805" :columnOptions="companyCodecolumnOptions" propsValue="F_Id" relationField="F_FullName" popupType="dialog"
popupTitle="选择数据" popupWidth="800px"
>
</el-input> </popupSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="仓库位置" prop="location"> <el-form-item label="仓库位置"
<el-input v-model="dataForm.location" placeholder="请输入" clearable :style='{"width":"100%"}'> prop="location" >
<el-input v-model="dataForm.location"
placeholder="请输入仓库位置" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="仓库类型" prop="type"> <el-form-item label="仓库类型"
<el-select v-model="dataForm.type" placeholder="请选择" clearable :style='{"width":"100%"}'> prop="type" >
<el-option v-for="(item, index) in typeOptions" :key="index" :label="item.fullName" <el-select v-model="dataForm.type"
:value="item.id" :disabled="item.disabled"></el-option> placeholder="请选择仓库类型" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in typeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="ERP库存组织" prop="organization"> <el-form-item label="ERP子库"
<el-select v-model="dataForm.organization" placeholder="请选择" clearable prop="sublibrary" >
:style='{"width":"100%"}'> <popupSelect v-model="dataForm.sublibrary"
<el-option v-for="(item, index) in organizationOptions" :key="index" placeholder="请选择子库" clearable field="sublibrary" interfaceId="394818245032483845" :columnOptions="sublibrarycolumnOptions" propsValue="id" relationField="inventory_org_detail_name" popupType="dialog"
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option> popupTitle="选择数据" popupWidth="800px"
>
</el-select> </popupSelect>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="ERP子库" prop="sublibrary">
<el-select v-model="dataForm.sublibrary" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in sublibraryOptions" :key="index"
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="激活状态 " prop="activestate"> <el-form-item label="激活状态 "
<!-- <el-radio-group v-model="dataForm.activestate" size="small"> prop="activestate" >
<el-radio v-for="(item, index) in activestateOptions" :key="index" :label="item.id" <el-radio-group v-model="dataForm.activestate"
:disabled="item.disabled"> size="small" >
<el-radio v-for="(item, index) in activestateOptions" :key="index" :label="item.id" :disabled="item.disabled" >
{{item.fullName}} {{item.fullName}}
</el-radio> </el-radio>
</el-radio-group> --> </el-radio-group>
<el-switch v-model="dataForm.activestate" :active-value="1" :inactive-value="0">
</el-switch>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="创建人名称" prop="creatorusername">
<el-input v-model="dataForm.creatorusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<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-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="修改人名称" prop="lastmodifyusername"> <el-form-item label="备注"
<el-input v-model="dataForm.lastmodifyusername" placeholder="请输入" clearable prop="remark" >
:style='{"width":"100%"}'> <el-input v-model="dataForm.remark"
placeholder="请输入备注" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24">
<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>
</template> </template>
</el-form> </el-form>
</el-row> </el-row>
@ -130,12 +97,8 @@
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import { import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
getDataInterfaceRes import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
export default { export default {
components: {}, components: {},
props: [], props: [],
@ -146,105 +109,34 @@
isDetail: false, isDetail: false,
dataForm: { dataForm: {
code : '', code : '',
companyCode: '', name : '',
companyName: '', companyCode : "",
location : '', location : '',
type : "", type : "",
organization: "",
sublibrary : "", sublibrary : "",
activestate: "1", activestate : "2",
remark : '', remark : '',
creatorusername: '', creatorUserName : "",
creatortime: '', creatorTime : "",
lastmodifyusername: '', lastModifyUserName : "",
lastmodifytime: '', lastModifyTime : "",
orgId : "",
departmentId : "",
}, },
rules: { rules:
code: [{ {
required: true,
message: '请输入',
trigger: 'blur'
}, ],
type: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
organization: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
sublibrary: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
}, },
typeOptions: [{ companyCodecolumnOptions:[ {"label":"公司名称","value":"F_FullName"}, {"label":"公司编码","value":"F_EnCode"},],
"fullName": "原料库", typeOptions:[{"fullName":"原料库","id":"0"},{"fullName":"中间库","id":"1"},{"fullName":"成品库","id":"2"},{"fullName":"副产品库","id":"3"},{"fullName":"废次品库","id":"4"},{"fullName":"备件辅材库","id":"5"},{"fullName":"贸易虚拟库","id":"6"},{"fullName":"仓储库","id":"7"},{"fullName":"能源库","id":"8"},{"fullName":"其他库","id":"9"},{"fullName":"帐外库","id":"10"}],
"id": "0" sublibrarycolumnOptions:[ {"label":"编码","value":"inventory_org_detail_code"}, {"label":"库存组织详细名称","value":"inventory_org_detail_name"}, {"label":"库存组织名称","value":"inventory_org_name"},],
}, { activestateOptions:[{"fullName":"激活","id":"1"},{"fullName":"未激活","id":"0"}],
"fullName": "中间库",
"id": "1"
}, {
"fullName": "成品库",
"id": "2"
}, {
"fullName": "副产品库",
"id": "3"
}, {
"fullName": "废次品库",
"id": "4"
}, {
"fullName": "备件辅材库",
"id": "5"
}, {
"fullName": "贸易虚拟库",
"id": "6"
}, {
"fullName": "仓储库",
"id": "7"
}, {
"fullName": "能源库",
"id": "8"
}, {
"fullName": "其他库",
"id": "9"
}, {
"fullName": "帐外库",
"id": "10"
}],
organizationOptions: [{
"fullName": "济钢集团",
"id": "0"
}, {
"fullName": "日照",
"id": "1"
}],
sublibraryOptions: [{
"fullName": "城市矿产钢材库",
"id": "0"
}, {
"fullName": "黄河爆破待发库",
"id": "1"
}, {
"fullName": "黄河爆破完工库",
"id": "2"
}],
/* activestateOptions: [{
"fullName": "激活",
"id": "1"
}, {
"fullName": "未激活",
"id": "0"
}], */
} }
}, },
computed: {}, computed: {},
watch: {}, watch: {},
created() {}, created() {
},
mounted() {}, mounted() {},
methods: { methods: {
clearData(data){ clearData(data){
@ -267,7 +159,7 @@
if(this.dataForm.id){ if(this.dataForm.id){
this.loading = true this.loading = true
request({ request({
url: '/api/warehouse/Warehouse/' + this.dataForm.id, url: '/api/example/WareHouse/'+this.dataForm.id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
@ -291,7 +183,7 @@
var _data =this.dataList() var _data =this.dataList()
if (!this.dataForm.id) { if (!this.dataForm.id) {
request({ request({
url: '/api/warehouse/Warehouse', url: '/api/example/WareHouse',
method: 'post', method: 'post',
data: _data data: _data
}).then((res) => { }).then((res) => {
@ -307,7 +199,7 @@
}) })
}else{ }else{
request({ request({
url: '/api/warehouse/Warehouse/' + this.dataForm.id, url: '/api/example/WareHouse/'+this.dataForm.id,
method: 'PUT', method: 'PUT',
data: _data data: _data
}).then((res) => { }).then((res) => {
@ -333,4 +225,5 @@
}, },
}, },
} }
</script> </script>

@ -5,16 +5,13 @@
<el-row class="JNPF-common-search-box" :gutter="16"> <el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent> <el-form @submit.native.prevent>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="激活状态 "> <el-form-item label="仓库编码">
<el-select v-model="query.activestate" placeholder="请选择" clearable> <el-input v-model="query.code" placeholder="请输入" clearable> </el-input>
<el-option v-for="(item, index) in activestateOptions" :key="index"
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="仓库编码"> <el-form-item label="仓库名称">
<el-input v-model="query.code" placeholder="请输入" clearable> </el-input> <el-input v-model="query.name" placeholder="请输入" clearable> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@ -43,48 +40,43 @@
<screenfull isContainer/> <screenfull isContainer/>
</div> </div>
</div> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
@selection-change="handleSelectionChange"> <el-table-column prop="code" label="仓库编码" width="0" align="left"
<el-table-column prop="code" label="仓库编码" width="0" align="left" /> />
<el-table-column label="激活状态 " width="0" prop="activestate" algin="left"> <el-table-column prop="name" label="仓库名称" width="0" align="left"
<template slot-scope="scope"> />
{{ scope.row.activestate | dynamicText(activestateOptions) }} <el-table-column prop="companyCode" label="公司" width="0" align="left"
</template> />
</el-table-column> <el-table-column prop="location" label="仓库位置" width="0" align="left"
<el-table-column prop="companyCode" label="公司代码" width="0" align="left" /> />
<el-table-column prop="companyName" label="公司名称" width="0" align="left" /> <el-table-column label="仓库类型" width="0" prop="type" algin="left"
<el-table-column label="仓库类型" width="0" prop="type" algin="left"> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.type | dynamicText(typeOptions) }} {{ scope.row.type | dynamicText(typeOptions) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="ERP库存组织" width="0" prop="organization" algin="left"> <el-table-column prop="sublibrary" label="ERP子库" width="0" align="left"
<template slot-scope="scope"> />
{{ scope.row.organization | dynamicText(organizationOptions) }} <el-table-column label="激活状态 " width="0" prop="activestate" algin="left"
</template> >
</el-table-column>
<el-table-column label="ERP子库" width="0" prop="sublibrary" algin="left">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.sublibrary | dynamicText(sublibraryOptions) }} {{ scope.row.activestate | dynamicText(activestateOptions) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="location" label="仓库位置" width="0" align="left" /> <el-table-column prop="remark" label="备注" width="0" align="left"
<el-table-column prop="creatorusername" label="创建人名称" width="0" align="left" /> />
<el-table-column prop="creatortime" label="创建时间" width="0" align="left" /> <el-table-column label="操作" fixed="right"
<el-table-column prop="lastmodifyusername" label="修改人名称" width="0" align="left" /> width="100" >
<el-table-column prop="lastmodifytime" label="修改时间" width="0" align="left" />
<el-table-column prop="remark" label="备注" width="0" align="left" />
<el-table-column label="操作" fixed="right" width="100">
<template slot-scope="scope"> <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>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)"> <el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</JNPF-table> </JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
@pagination="initData" />
</div> </div>
</div> </div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/> <JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
@ -95,28 +87,20 @@
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import { import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import JNPFForm from './Form' import JNPFForm from './Form'
import ExportBox from './ExportBox' import ExportBox from './ExportBox'
import { import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import Detail from './Detail' import Detail from './Detail'
export default { export default {
components: { components: {JNPFForm, ExportBox,Detail},
JNPFForm,
ExportBox,
Detail
},
data() { data() {
return { return {
detailVisible: false, detailVisible: false,
query: { query: {
activestate: undefined,
code:undefined, code:undefined,
name:undefined,
}, },
treeProps: { treeProps: {
children: 'children', children: 'children',
@ -125,143 +109,29 @@
}, },
list: [], list: [],
listLoading: true, listLoading: true,
multipleSelection: [], multipleSelection: [], total: 0,
total: 0,
listQuery: { listQuery: {
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
sort: "desc", sort: "desc",
sidx: "", sidx: "creatorTime",
}, },
formVisible: false, formVisible: false,
exportBoxVisible: false, exportBoxVisible: false,
columnList: [{ columnList: [
prop: 'code', {prop: 'code', label: '仓库编码'},
label: '仓库编码' {prop: 'name', label: '仓库名称'},
}, {prop: 'companyCode', label: '公司'},
{ {prop: 'location', label: '仓库位置'},
prop: 'activestate', {prop: 'type', label: '仓库类型'},
label: '激活状态 ' {prop: 'sublibrary', label: 'ERP子库'},
}, {prop: 'activestate', label: '激活状态 '},
{ {prop: 'remark', label: '备注'},
prop: 'companyCode',
label: '公司代码'
},
{
prop: 'companyName',
label: '公司名称'
},
{
prop: 'type',
label: '仓库类型'
},
{
prop: 'organization',
label: 'ERP库存组织'
},
{
prop: 'sublibrary',
label: 'ERP子库'
},
{
prop: 'location',
label: '仓库位置'
},
{
prop: 'creatorusername',
label: '创建人名称'
},
{
prop: 'creatortime',
label: '创建时间'
},
{
prop: 'lastmodifyusername',
label: '修改人名称'
},
{
prop: 'lastmodifytime',
label: '修改时间'
},
{
prop: 'remark',
label: '备注'
},
], ],
typeOptions: [{ typeOptions:[{"fullName":"原料库","id":"0"},{"fullName":"中间库","id":"1"},{"fullName":"成品库","id":"2"},{"fullName":"副产品库","id":"3"},{"fullName":"废次品库","id":"4"},{"fullName":"备件辅材库","id":"5"},{"fullName":"贸易虚拟库","id":"6"},{"fullName":"仓储库","id":"7"},{"fullName":"能源库","id":"8"},{"fullName":"其他库","id":"9"},{"fullName":"帐外库","id":"10"}],
"fullName": "原料库", typeProps:{"label":"fullName","value":"id"},
"id": "0" activestateOptions:[{"fullName":"激活","id":"1"},{"fullName":"未激活","id":"0"}],
}, { activestateProps:{"label":"fullName","value":"id"},
"fullName": "中间库",
"id": "1"
}, {
"fullName": "成品库",
"id": "2"
}, {
"fullName": "副产品库",
"id": "3"
}, {
"fullName": "废次品库",
"id": "4"
}, {
"fullName": "备件辅材库",
"id": "5"
}, {
"fullName": "贸易虚拟库",
"id": "6"
}, {
"fullName": "仓储库",
"id": "7"
}, {
"fullName": "能源库",
"id": "8"
}, {
"fullName": "其他库",
"id": "9"
}, {
"fullName": "帐外库",
"id": "10"
}],
typeProps: {
"label": "fullName",
"value": "id"
},
organizationOptions: [{
"fullName": "济钢集团",
"id": "0"
}, {
"fullName": "日照",
"id": "1"
}],
organizationProps: {
"label": "fullName",
"value": "id"
},
sublibraryOptions: [{
"fullName": "城市矿产钢材库",
"id": "0"
}, {
"fullName": "黄河爆破待发库",
"id": "1"
}, {
"fullName": "黄河爆破完工库",
"id": "2"
}],
sublibraryProps: {
"label": "fullName",
"value": "id"
},
activestateOptions: [{
"fullName": "激活",
"id": "1"
}, {
"fullName": "未激活",
"id": "0"
}],
activestateProps: {
"label": "fullName",
"value": "id"
},
} }
}, },
computed: { computed: {
@ -279,11 +149,7 @@
this.$refs.Detail.init(id) this.$refs.Detail.init(id)
}) })
}, },
sortChange({ sortChange({column, prop, order}) {
column,
prop,
order
}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc' this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop this.listQuery.sidx = !order ? '' : prop
this.initData() this.initData()
@ -296,7 +162,7 @@
menuId:this.menuId menuId:this.menuId
}; };
request({ request({
url: `/api/warehouse/Warehouse/getList`, url: `/api/example/WareHouse/getList`,
method: 'post', method: 'post',
data: _query data: _query
}).then(res => { }).then(res => {
@ -316,7 +182,7 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
request({ request({
url: `/api/warehouse/Warehouse/${id}`, url: `/api/example/WareHouse/${id}`,
method: 'DELETE' method: 'DELETE'
}).then(res => { }).then(res => {
this.$message({ this.$message({
@ -327,7 +193,8 @@
} }
}); });
}) })
}).catch(() => {}); }).catch(() => {
});
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
const res = val.map(item => item.id) const res = val.map(item => item.id)
@ -347,7 +214,7 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
request({ request({
url: `/api/warehouse/Warehouse/batchRemove/${ids}`, url: `/api/example/WareHouse/batchRemove/${ids}`,
method: 'DELETE' method: 'DELETE'
}).then(res => { }).then(res => {
this.$message({ this.$message({
@ -358,7 +225,8 @@
} }
}); });
}) })
}).catch(() => {}) }).catch(() => {
})
}, },
addOrUpdateHandle(id, isDetail) { addOrUpdateHandle(id, isDetail) {
this.formVisible = true this.formVisible = true
@ -373,14 +241,9 @@
}) })
}, },
download(data) { download(data) {
let query = { let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
...data,
...this.listQuery,
...this.query,
menuId: this.menuId
}
request({ request({
url: `/api/warehouse/Warehouse/Actions/Export`, url: `/api/example/WareHouse/Actions/Export`,
method: 'GET', method: 'GET',
data: query data: query
}).then(res => { }).then(res => {
@ -395,7 +258,7 @@
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
sort: "desc", sort: "desc",
sidx: "", sidx: "creatorTime",
} }
this.initData() this.initData()
}, },

Loading…
Cancel
Save