jg-waiwang-pro
XI_TENG\xixi_ 8 months ago
parent e901e4b78b
commit 98b31edb7e

@ -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.mapper.WarehousingInspectionConclusionMapper">
</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.mapper.WarehousingInspectionMapper">
</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.mapper.WarehousingInspectionProductMapper">
</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.mapper.WarehousingInspectionVoucherMapper">
</mapper>

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.WarehousingInspectionConclusionEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* warehousingInspection
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-23
*/
public interface WarehousingInspectionConclusionMapper extends BaseMapper<WarehousingInspectionConclusionEntity> {
}

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.WarehousingInspectionEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* warehousingInspection
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-23
*/
public interface WarehousingInspectionMapper extends BaseMapper<WarehousingInspectionEntity> {
}

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.WarehousingInspectionProductEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* warehousingInspection
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-23
*/
public interface WarehousingInspectionProductMapper extends BaseMapper<WarehousingInspectionProductEntity> {
}

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.WarehousingInspectionVoucherEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* warehousingInspection
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-23
*/
public interface WarehousingInspectionVoucherMapper extends BaseMapper<WarehousingInspectionVoucherEntity> {
}

@ -0,0 +1,18 @@
package jnpf.service;
import jnpf.model.warehousinginspection.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* warehousingInspection
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-23
*/
public interface WarehousingInspectionConclusionService extends IService<WarehousingInspectionConclusionEntity> {
QueryWrapper<WarehousingInspectionConclusionEntity> getChild(WarehousingInspectionPagination pagination,QueryWrapper<WarehousingInspectionConclusionEntity> warehousingInspectionConclusionQueryWrapper);
}

@ -0,0 +1,18 @@
package jnpf.service;
import jnpf.model.warehousinginspection.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* warehousingInspection
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-23
*/
public interface WarehousingInspectionProductService extends IService<WarehousingInspectionProductEntity> {
QueryWrapper<WarehousingInspectionProductEntity> getChild(WarehousingInspectionPagination pagination,QueryWrapper<WarehousingInspectionProductEntity> warehousingInspectionProductQueryWrapper);
}

@ -0,0 +1,47 @@
package jnpf.service;
import jnpf.model.warehousinginspection.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* warehousingInspection
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-23
*/
public interface WarehousingInspectionService extends IService<WarehousingInspectionEntity> {
List<WarehousingInspectionEntity> getList(WarehousingInspectionPagination warehousingInspectionPagination);
List<WarehousingInspectionEntity> getTypeList(WarehousingInspectionPagination warehousingInspectionPagination,String dataType);
WarehousingInspectionEntity getInfo(String id);
void delete(WarehousingInspectionEntity entity);
void create(WarehousingInspectionEntity entity);
boolean update(String id, WarehousingInspectionEntity entity);
//子表方法
List<WarehousingInspectionVoucherEntity> getWarehousingInspectionVoucherList(String id,WarehousingInspectionPagination warehousingInspectionPagination);
List<WarehousingInspectionVoucherEntity> getWarehousingInspectionVoucherList(String id);
List<WarehousingInspectionProductEntity> getWarehousingInspectionProductList(String id,WarehousingInspectionPagination warehousingInspectionPagination);
List<WarehousingInspectionProductEntity> getWarehousingInspectionProductList(String id);
List<WarehousingInspectionConclusionEntity> getWarehousingInspectionConclusionList(String id,WarehousingInspectionPagination warehousingInspectionPagination);
List<WarehousingInspectionConclusionEntity> getWarehousingInspectionConclusionList(String id);
//副表数据方法
String checkForm(WarehousingInspectionForm form,int i);
void saveOrUpdate(WarehousingInspectionForm warehousingInspectionForm,String id, boolean isSave) throws Exception;
}

@ -0,0 +1,18 @@
package jnpf.service;
import jnpf.model.warehousinginspection.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* warehousingInspection
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-23
*/
public interface WarehousingInspectionVoucherService extends IService<WarehousingInspectionVoucherEntity> {
QueryWrapper<WarehousingInspectionVoucherEntity> getChild(WarehousingInspectionPagination pagination,QueryWrapper<WarehousingInspectionVoucherEntity> warehousingInspectionVoucherQueryWrapper);
}

@ -0,0 +1,59 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.WarehousingInspectionConclusionMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.warehousinginspection.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.util.GeneraterSwapUtil;
import jnpf.database.model.superQuery.SuperQueryJsonModel;
import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
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.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* warehousingInspection
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-23
*/
@Service
public class WarehousingInspectionConclusionServiceImpl extends ServiceImpl<WarehousingInspectionConclusionMapper, WarehousingInspectionConclusionEntity> implements WarehousingInspectionConclusionService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
//子表过滤方法
@Override
public QueryWrapper<WarehousingInspectionConclusionEntity> getChild(WarehousingInspectionPagination pagination, QueryWrapper<WarehousingInspectionConclusionEntity> warehousingInspectionConclusionQueryWrapper){
boolean pcPermission = true;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String ruleQueryJson = isPc?WarehousingInspectionConstant.getColumnData():WarehousingInspectionConstant.getAppColumnData();
ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson,ColumnDataModel.class);
String ruleJson = isPc?JsonUtil.getObjectToString(dataModel.getRuleList()):JsonUtil.getObjectToString(dataModel.getRuleListApp());
if(isPc){
}
return warehousingInspectionConclusionQueryWrapper;
}
}

@ -0,0 +1,59 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.WarehousingInspectionProductMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.warehousinginspection.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.util.GeneraterSwapUtil;
import jnpf.database.model.superQuery.SuperQueryJsonModel;
import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
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.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* warehousingInspection
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-23
*/
@Service
public class WarehousingInspectionProductServiceImpl extends ServiceImpl<WarehousingInspectionProductMapper, WarehousingInspectionProductEntity> implements WarehousingInspectionProductService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
//子表过滤方法
@Override
public QueryWrapper<WarehousingInspectionProductEntity> getChild(WarehousingInspectionPagination pagination, QueryWrapper<WarehousingInspectionProductEntity> warehousingInspectionProductQueryWrapper){
boolean pcPermission = true;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String ruleQueryJson = isPc?WarehousingInspectionConstant.getColumnData():WarehousingInspectionConstant.getAppColumnData();
ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson,ColumnDataModel.class);
String ruleJson = isPc?JsonUtil.getObjectToString(dataModel.getRuleList()):JsonUtil.getObjectToString(dataModel.getRuleListApp());
if(isPc){
}
return warehousingInspectionProductQueryWrapper;
}
}

@ -0,0 +1,637 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.WarehousingInspectionMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.warehousinginspection.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.util.GeneraterSwapUtil;
import jnpf.database.model.superQuery.SuperQueryJsonModel;
import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.regex.Pattern;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
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.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* warehousingInspection
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-23
*/
@Service
public class WarehousingInspectionServiceImpl extends ServiceImpl<WarehousingInspectionMapper, WarehousingInspectionEntity> implements WarehousingInspectionService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private WarehousingInspectionVoucherService warehousingInspectionVoucherService;
@Autowired
private WarehousingInspectionProductService warehousingInspectionProductService;
@Autowired
private WarehousingInspectionConclusionService warehousingInspectionConclusionService;
@Override
public List<WarehousingInspectionEntity> getList(WarehousingInspectionPagination warehousingInspectionPagination){
return getTypeList(warehousingInspectionPagination,warehousingInspectionPagination.getDataType());
}
/** 列表查询 */
@Override
public List<WarehousingInspectionEntity> getTypeList(WarehousingInspectionPagination warehousingInspectionPagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
List<List<String>> intersectionList =new ArrayList<>();
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String columnData = !isPc ? WarehousingInspectionConstant.getAppColumnData() : WarehousingInspectionConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int warehousingInspectionNum =0;
QueryWrapper<WarehousingInspectionEntity> warehousingInspectionQueryWrapper=new QueryWrapper<>();
int warehousingInspectionConclusionNum =0;
QueryWrapper<WarehousingInspectionConclusionEntity> warehousingInspectionConclusionQueryWrapper=new QueryWrapper<>();
int warehousingInspectionProductNum =0;
QueryWrapper<WarehousingInspectionProductEntity> warehousingInspectionProductQueryWrapper=new QueryWrapper<>();
int warehousingInspectionVoucherNum =0;
QueryWrapper<WarehousingInspectionVoucherEntity> warehousingInspectionVoucherQueryWrapper=new QueryWrapper<>();
long warehousingInspectionConclusioncount = warehousingInspectionConclusionService.count();
long warehousingInspectionProductcount = warehousingInspectionProductService.count();
long warehousingInspectionVouchercount = warehousingInspectionVoucherService.count();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(warehousingInspectionPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = warehousingInspectionPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<WarehousingInspectionEntity> warehousingInspectionSuperWrapper = new QueryWrapper<>();
warehousingInspectionSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(warehousingInspectionSuperWrapper,WarehousingInspectionEntity.class,queryJson,"0"));
int warehousingInspectionNum1 = warehousingInspectionSuperWrapper.getExpression().getNormal().size();
if (warehousingInspectionNum1>0){
List<String> warehousingInspectionList =this.list(warehousingInspectionSuperWrapper).stream().map(WarehousingInspectionEntity::getId).collect(Collectors.toList());
allSuperList.addAll(warehousingInspectionList);
intersectionSuperList.add(warehousingInspectionList);
superNum++;
}
String warehousingInspectionConclusionTable = "jg_warehousing_inspection_conclusion";
boolean warehousingInspectionConclusionHasSql = queryJson.contains(warehousingInspectionConclusionTable);
List<String> warehousingInspectionConclusionList = generaterSwapUtil.selectIdsByChildCondition(WarehousingInspectionConstant.getTableList(), warehousingInspectionConclusionTable , queryJson, null);
if (warehousingInspectionConclusionHasSql){
allSuperList.addAll(warehousingInspectionConclusionList);
intersectionSuperList.add(warehousingInspectionConclusionList);
superNum++;
}
String warehousingInspectionProductTable = "jg_warehousing_inspection_product";
boolean warehousingInspectionProductHasSql = queryJson.contains(warehousingInspectionProductTable);
List<String> warehousingInspectionProductList = generaterSwapUtil.selectIdsByChildCondition(WarehousingInspectionConstant.getTableList(), warehousingInspectionProductTable , queryJson, null);
if (warehousingInspectionProductHasSql){
allSuperList.addAll(warehousingInspectionProductList);
intersectionSuperList.add(warehousingInspectionProductList);
superNum++;
}
String warehousingInspectionVoucherTable = "jg_warehousing_inspection_voucher";
boolean warehousingInspectionVoucherHasSql = queryJson.contains(warehousingInspectionVoucherTable);
List<String> warehousingInspectionVoucherList = generaterSwapUtil.selectIdsByChildCondition(WarehousingInspectionConstant.getTableList(), warehousingInspectionVoucherTable , queryJson, null);
if (warehousingInspectionVoucherHasSql){
allSuperList.addAll(warehousingInspectionVoucherList);
intersectionSuperList.add(warehousingInspectionVoucherList);
superNum++;
}
superOp = superNum > 0 ? superJsonModel.getMatchLogic() : "";
//and or
if(superOp.equalsIgnoreCase("and")){
allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList);
}else{
allSuperIDlist = allSuperList;
}
}
List<String> allRuleIDlist = new ArrayList<>();
String ruleOp ="";
if (ObjectUtil.isNotEmpty(ruleJson)){
List<String> allRuleList = new ArrayList<>();
List<List<String>> intersectionRuleList = new ArrayList<>();
SuperJsonModel ruleJsonModel = JsonUtil.getJsonToBean(ruleJson, SuperJsonModel.class);
int ruleNum = 0;
QueryWrapper<WarehousingInspectionEntity> warehousingInspectionSuperWrapper = new QueryWrapper<>();
warehousingInspectionSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(warehousingInspectionSuperWrapper,WarehousingInspectionEntity.class,ruleJson,"0"));
int warehousingInspectionNum1 = warehousingInspectionSuperWrapper.getExpression().getNormal().size();
if (warehousingInspectionNum1>0){
List<String> warehousingInspectionList =this.list(warehousingInspectionSuperWrapper).stream().map(WarehousingInspectionEntity::getId).collect(Collectors.toList());
allRuleList.addAll(warehousingInspectionList);
intersectionRuleList.add(warehousingInspectionList);
ruleNum++;
}
String warehousingInspectionConclusionTable = "jg_warehousing_inspection_conclusion";
boolean warehousingInspectionConclusionHasSql = ruleJson.contains(warehousingInspectionConclusionTable);
List<String> warehousingInspectionConclusionList = generaterSwapUtil.selectIdsByChildCondition(WarehousingInspectionConstant.getTableList(), warehousingInspectionConclusionTable , ruleJson, null);
if (warehousingInspectionConclusionHasSql){
allRuleList.addAll(warehousingInspectionConclusionList);
intersectionRuleList.add(warehousingInspectionConclusionList);
ruleNum++;
}
String warehousingInspectionProductTable = "jg_warehousing_inspection_product";
boolean warehousingInspectionProductHasSql = ruleJson.contains(warehousingInspectionProductTable);
List<String> warehousingInspectionProductList = generaterSwapUtil.selectIdsByChildCondition(WarehousingInspectionConstant.getTableList(), warehousingInspectionProductTable , ruleJson, null);
if (warehousingInspectionProductHasSql){
allRuleList.addAll(warehousingInspectionProductList);
intersectionRuleList.add(warehousingInspectionProductList);
ruleNum++;
}
String warehousingInspectionVoucherTable = "jg_warehousing_inspection_voucher";
boolean warehousingInspectionVoucherHasSql = ruleJson.contains(warehousingInspectionVoucherTable);
List<String> warehousingInspectionVoucherList = generaterSwapUtil.selectIdsByChildCondition(WarehousingInspectionConstant.getTableList(), warehousingInspectionVoucherTable , ruleJson, null);
if (warehousingInspectionVoucherHasSql){
allRuleList.addAll(warehousingInspectionVoucherList);
intersectionRuleList.add(warehousingInspectionVoucherList);
ruleNum++;
}
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or
if(ruleOp.equalsIgnoreCase("and")){
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
}else{
allRuleIDlist = allRuleList;
}
}
boolean pcPermission = true;
boolean appPermission = false;
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object warehousingInspectionObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingInspectionQueryWrapper,WarehousingInspectionEntity.class,warehousingInspectionPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingInspectionObj)){
return new ArrayList<>();
} else {
warehousingInspectionQueryWrapper = (QueryWrapper<WarehousingInspectionEntity>)warehousingInspectionObj;
if( warehousingInspectionQueryWrapper.getExpression().getNormal().size()>0){
warehousingInspectionNum++;
}
}
Object warehousingInspectionConclusionObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingInspectionConclusionQueryWrapper,WarehousingInspectionConclusionEntity.class,warehousingInspectionPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingInspectionConclusionObj)){
return new ArrayList<>();
} else {
warehousingInspectionConclusionQueryWrapper = (QueryWrapper<WarehousingInspectionConclusionEntity>)warehousingInspectionConclusionObj;
if( warehousingInspectionConclusionQueryWrapper.getExpression().getNormal().size()>0){
warehousingInspectionConclusionNum++;
}
}
Object warehousingInspectionProductObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingInspectionProductQueryWrapper,WarehousingInspectionProductEntity.class,warehousingInspectionPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingInspectionProductObj)){
return new ArrayList<>();
} else {
warehousingInspectionProductQueryWrapper = (QueryWrapper<WarehousingInspectionProductEntity>)warehousingInspectionProductObj;
if( warehousingInspectionProductQueryWrapper.getExpression().getNormal().size()>0){
warehousingInspectionProductNum++;
}
}
Object warehousingInspectionVoucherObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingInspectionVoucherQueryWrapper,WarehousingInspectionVoucherEntity.class,warehousingInspectionPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingInspectionVoucherObj)){
return new ArrayList<>();
} else {
warehousingInspectionVoucherQueryWrapper = (QueryWrapper<WarehousingInspectionVoucherEntity>)warehousingInspectionVoucherObj;
if( warehousingInspectionVoucherQueryWrapper.getExpression().getNormal().size()>0){
warehousingInspectionVoucherNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object warehousingInspectionObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingInspectionQueryWrapper,WarehousingInspectionEntity.class,warehousingInspectionPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingInspectionObj)){
return new ArrayList<>();
} else {
warehousingInspectionQueryWrapper = (QueryWrapper<WarehousingInspectionEntity>)warehousingInspectionObj;
if( warehousingInspectionQueryWrapper.getExpression().getNormal().size()>0){
warehousingInspectionNum++;
}
}
Object warehousingInspectionConclusionObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingInspectionConclusionQueryWrapper,WarehousingInspectionConclusionEntity.class,warehousingInspectionPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingInspectionConclusionObj)){
return new ArrayList<>();
} else {
warehousingInspectionConclusionQueryWrapper = (QueryWrapper<WarehousingInspectionConclusionEntity>)warehousingInspectionConclusionObj;
if( warehousingInspectionConclusionQueryWrapper.getExpression().getNormal().size()>0){
warehousingInspectionConclusionNum++;
}
}
Object warehousingInspectionProductObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingInspectionProductQueryWrapper,WarehousingInspectionProductEntity.class,warehousingInspectionPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingInspectionProductObj)){
return new ArrayList<>();
} else {
warehousingInspectionProductQueryWrapper = (QueryWrapper<WarehousingInspectionProductEntity>)warehousingInspectionProductObj;
if( warehousingInspectionProductQueryWrapper.getExpression().getNormal().size()>0){
warehousingInspectionProductNum++;
}
}
Object warehousingInspectionVoucherObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(warehousingInspectionVoucherQueryWrapper,WarehousingInspectionVoucherEntity.class,warehousingInspectionPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(warehousingInspectionVoucherObj)){
return new ArrayList<>();
} else {
warehousingInspectionVoucherQueryWrapper = (QueryWrapper<WarehousingInspectionVoucherEntity>)warehousingInspectionVoucherObj;
if( warehousingInspectionVoucherQueryWrapper.getExpression().getNormal().size()>0){
warehousingInspectionVoucherNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(warehousingInspectionPagination.getInspectionCode())){
warehousingInspectionNum++;
String value = warehousingInspectionPagination.getInspectionCode() instanceof List ?
JsonUtil.getObjectToString(warehousingInspectionPagination.getInspectionCode()) :
String.valueOf(warehousingInspectionPagination.getInspectionCode());
warehousingInspectionQueryWrapper.lambda().like(WarehousingInspectionEntity::getInspectionCode,value);
}
if(ObjectUtil.isNotEmpty(warehousingInspectionPagination.getCreatorTime())){
warehousingInspectionNum++;
List CreatorTimeList = JsonUtil.getJsonToList(warehousingInspectionPagination.getCreatorTime(),String.class);
Long fir = Long.valueOf(String.valueOf(CreatorTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(CreatorTimeList.get(1)));
warehousingInspectionQueryWrapper.lambda().ge(WarehousingInspectionEntity::getCreatorTime, new Date(fir))
.le(WarehousingInspectionEntity::getCreatorTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
if(ObjectUtil.isNotEmpty(warehousingInspectionPagination.getInspectionType())){
warehousingInspectionNum++;
List<String> idList = new ArrayList<>();
try {
String[][] inspectionType = JsonUtil.getJsonToBean(warehousingInspectionPagination.getInspectionType(),String[][].class);
for(int i=0;i<inspectionType.length;i++){
if(inspectionType[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(inspectionType[i])));
}
}
}catch (Exception e1){
try {
List<String> inspectionType = JsonUtil.getJsonToList(warehousingInspectionPagination.getInspectionType(),String.class);
if(inspectionType.size()>0){
idList.addAll(inspectionType);
}
}catch (Exception e2){
idList.add(String.valueOf(warehousingInspectionPagination.getInspectionType()));
}
}
warehousingInspectionQueryWrapper.lambda().and(t->{
idList.forEach(tt->{
t.like(WarehousingInspectionEntity::getInspectionType, tt).or();
});
});
}
if(ObjectUtil.isNotEmpty(warehousingInspectionPagination.getBelongUserId())){
warehousingInspectionNum++;
List<String> idList = new ArrayList<>();
try {
String[][] belongUserId = JsonUtil.getJsonToBean(warehousingInspectionPagination.getBelongUserId(),String[][].class);
for(int i=0;i<belongUserId.length;i++){
if(belongUserId[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(belongUserId[i])));
}
}
}catch (Exception e1){
try {
List<String> belongUserId = JsonUtil.getJsonToList(warehousingInspectionPagination.getBelongUserId(),String.class);
if(belongUserId.size()>0){
idList.addAll(belongUserId);
}
}catch (Exception e2){
idList.add(String.valueOf(warehousingInspectionPagination.getBelongUserId()));
}
}
warehousingInspectionQueryWrapper.lambda().and(t->{
idList.forEach(tt->{
t.like(WarehousingInspectionEntity::getBelongUserId, tt).or();
});
});
}
if(ObjectUtil.isNotEmpty(warehousingInspectionPagination.getInspectionTime())){
warehousingInspectionNum++;
List InspectionTimeList = JsonUtil.getJsonToList(warehousingInspectionPagination.getInspectionTime(),String.class);
Long fir = Long.valueOf(String.valueOf(InspectionTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(InspectionTimeList.get(1)));
warehousingInspectionQueryWrapper.lambda().ge(WarehousingInspectionEntity::getInspectionTime, new Date(fir))
.le(WarehousingInspectionEntity::getInspectionTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
}
if(warehousingInspectionConclusionNum>0){
List<String> warehousingInspectionConclusionIdList = warehousingInspectionConclusionService.list(warehousingInspectionConclusionQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getInspectionId())).map(t->t.getInspectionId()).collect(Collectors.toList());
long count = warehousingInspectionConclusionService.count();
if (count>0){
intersectionList.add(warehousingInspectionConclusionIdList);
}
AllIdList.addAll(warehousingInspectionConclusionIdList);
}
total+=warehousingInspectionConclusionNum;
if(warehousingInspectionProductNum>0){
List<String> warehousingInspectionProductIdList = warehousingInspectionProductService.list(warehousingInspectionProductQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getInspectionId())).map(t->t.getInspectionId()).collect(Collectors.toList());
long count = warehousingInspectionProductService.count();
if (count>0){
intersectionList.add(warehousingInspectionProductIdList);
}
AllIdList.addAll(warehousingInspectionProductIdList);
}
total+=warehousingInspectionProductNum;
if(warehousingInspectionVoucherNum>0){
List<String> warehousingInspectionVoucherIdList = warehousingInspectionVoucherService.list(warehousingInspectionVoucherQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getInspectionId())).map(t->t.getInspectionId()).collect(Collectors.toList());
long count = warehousingInspectionVoucherService.count();
if (count>0){
intersectionList.add(warehousingInspectionVoucherIdList);
}
AllIdList.addAll(warehousingInspectionVoucherIdList);
}
total+=warehousingInspectionVoucherNum;
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
warehousingInspectionQueryWrapper.lambda().in(WarehousingInspectionEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
warehousingInspectionQueryWrapper.lambda().and(t->t.in(WarehousingInspectionEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
warehousingInspectionQueryWrapper.lambda().and(t->t.in(WarehousingInspectionEntity::getId, finalAllRuleIDlist));
}
//假删除标志
warehousingInspectionQueryWrapper.lambda().isNull(WarehousingInspectionEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(warehousingInspectionPagination.getSidx())){
warehousingInspectionQueryWrapper.lambda().orderByDesc(WarehousingInspectionEntity::getId);
}else{
try {
String sidx = warehousingInspectionPagination.getSidx();
String[] strs= sidx.split("_name");
WarehousingInspectionEntity warehousingInspectionEntity = new WarehousingInspectionEntity();
Field declaredField = warehousingInspectionEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
warehousingInspectionQueryWrapper="asc".equals(warehousingInspectionPagination.getSort().toLowerCase())?warehousingInspectionQueryWrapper.orderByAsc(value):warehousingInspectionQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<WarehousingInspectionEntity> page=new Page<>(warehousingInspectionPagination.getCurrentPage(), warehousingInspectionPagination.getPageSize());
IPage<WarehousingInspectionEntity> userIPage=this.page(page, warehousingInspectionQueryWrapper);
return warehousingInspectionPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<WarehousingInspectionEntity> list = new ArrayList();
return warehousingInspectionPagination.setData(list, list.size());
}
}else{
return this.list(warehousingInspectionQueryWrapper);
}
}
@Override
public WarehousingInspectionEntity getInfo(String id){
QueryWrapper<WarehousingInspectionEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(WarehousingInspectionEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(WarehousingInspectionEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, WarehousingInspectionEntity entity){
return this.updateById(entity);
}
@Override
public void delete(WarehousingInspectionEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** WarehousingInspectionVoucher子表方法 */
@Override
public List<WarehousingInspectionVoucherEntity> getWarehousingInspectionVoucherList(String id,WarehousingInspectionPagination warehousingInspectionPagination){
Map<String, Object> newtabMap=WarehousingInspectionConstant.TABLEFIELDKEY.entrySet()
.stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey()));
String tableName="warehousingInspectionVoucher";
tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString();
QueryWrapper<WarehousingInspectionVoucherEntity> queryWrapper = new QueryWrapper<>();
queryWrapper = warehousingInspectionVoucherService.getChild(warehousingInspectionPagination,queryWrapper);
queryWrapper.lambda().eq(WarehousingInspectionVoucherEntity::getInspectionId, id);
generaterSwapUtil.wrapperHandle(WarehousingInspectionConstant.getColumnData(), WarehousingInspectionConstant.getAppColumnData(), queryWrapper,WarehousingInspectionVoucherEntity.class,"sub",tableName);
return warehousingInspectionVoucherService.list(queryWrapper);
}
/** WarehousingInspectionVoucher子表方法 */
@Override
public List<WarehousingInspectionVoucherEntity> getWarehousingInspectionVoucherList(String id){
QueryWrapper<WarehousingInspectionVoucherEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(WarehousingInspectionVoucherEntity::getInspectionId, id);
return warehousingInspectionVoucherService.list(queryWrapper);
}
/** WarehousingInspectionProduct子表方法 */
@Override
public List<WarehousingInspectionProductEntity> getWarehousingInspectionProductList(String id,WarehousingInspectionPagination warehousingInspectionPagination){
Map<String, Object> newtabMap=WarehousingInspectionConstant.TABLEFIELDKEY.entrySet()
.stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey()));
String tableName="warehousingInspectionProduct";
tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString();
QueryWrapper<WarehousingInspectionProductEntity> queryWrapper = new QueryWrapper<>();
queryWrapper = warehousingInspectionProductService.getChild(warehousingInspectionPagination,queryWrapper);
queryWrapper.lambda().eq(WarehousingInspectionProductEntity::getInspectionId, id);
generaterSwapUtil.wrapperHandle(WarehousingInspectionConstant.getColumnData(), WarehousingInspectionConstant.getAppColumnData(), queryWrapper,WarehousingInspectionProductEntity.class,"sub",tableName);
return warehousingInspectionProductService.list(queryWrapper);
}
/** WarehousingInspectionProduct子表方法 */
@Override
public List<WarehousingInspectionProductEntity> getWarehousingInspectionProductList(String id){
QueryWrapper<WarehousingInspectionProductEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(WarehousingInspectionProductEntity::getInspectionId, id);
return warehousingInspectionProductService.list(queryWrapper);
}
/** WarehousingInspectionConclusion子表方法 */
@Override
public List<WarehousingInspectionConclusionEntity> getWarehousingInspectionConclusionList(String id,WarehousingInspectionPagination warehousingInspectionPagination){
Map<String, Object> newtabMap=WarehousingInspectionConstant.TABLEFIELDKEY.entrySet()
.stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey()));
String tableName="warehousingInspectionConclusion";
tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString();
QueryWrapper<WarehousingInspectionConclusionEntity> queryWrapper = new QueryWrapper<>();
queryWrapper = warehousingInspectionConclusionService.getChild(warehousingInspectionPagination,queryWrapper);
queryWrapper.lambda().eq(WarehousingInspectionConclusionEntity::getInspectionId, id);
generaterSwapUtil.wrapperHandle(WarehousingInspectionConstant.getColumnData(), WarehousingInspectionConstant.getAppColumnData(), queryWrapper,WarehousingInspectionConclusionEntity.class,"sub",tableName);
return warehousingInspectionConclusionService.list(queryWrapper);
}
/** WarehousingInspectionConclusion子表方法 */
@Override
public List<WarehousingInspectionConclusionEntity> getWarehousingInspectionConclusionList(String id){
QueryWrapper<WarehousingInspectionConclusionEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(WarehousingInspectionConclusionEntity::getInspectionId, id);
return warehousingInspectionConclusionService.list(queryWrapper);
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(WarehousingInspectionForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp){
id = form.getId();
}
//主表字段验证
//子表字段验证
if (form.getWarehousingInspectionVoucherList()!=null){
}
if (form.getWarehousingInspectionProductList()!=null){
}
if (form.getWarehousingInspectionConclusionList()!=null){
}
return countRecover;
}
/**
* ()
* @param id
* @param warehousingInspectionForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(WarehousingInspectionForm warehousingInspectionForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
warehousingInspectionForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(WarehousingInspectionConstant.getFormData(),warehousingInspectionForm),WarehousingInspectionForm.class);
WarehousingInspectionEntity entity = JsonUtil.getJsonToBean(warehousingInspectionForm, WarehousingInspectionEntity.class);
if(isSave){
String mainId = id ;
entity.setInspectionCode(generaterSwapUtil.getBillNumber("warehousingInspection", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setLastModifyTime(null);
entity.setLastModifyUserId(null);
entity.setId(mainId);
entity.setFlowId(warehousingInspectionForm.getFlowId());
entity.setVersion(0);
}else{
entity.setInspectionCode(generaterSwapUtil.getBillNumber("warehousingInspection", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setLastModifyTime(null);
entity.setLastModifyUserId(null);
entity.setFlowId(warehousingInspectionForm.getFlowId());
}
this.saveOrUpdate(entity);
//WarehousingInspectionVoucher子表数据新增修改
if(!isSave){
QueryWrapper<WarehousingInspectionVoucherEntity> WarehousingInspectionVoucherqueryWrapper = new QueryWrapper<>();
WarehousingInspectionVoucherqueryWrapper.lambda().eq(WarehousingInspectionVoucherEntity::getInspectionId, entity.getId());
warehousingInspectionVoucherService.remove(WarehousingInspectionVoucherqueryWrapper);
}
if (warehousingInspectionForm.getWarehousingInspectionVoucherList()!=null){
List<WarehousingInspectionVoucherEntity> tableField118 = JsonUtil.getJsonToList(warehousingInspectionForm.getWarehousingInspectionVoucherList(),WarehousingInspectionVoucherEntity.class);
for(WarehousingInspectionVoucherEntity entitys : tableField118){
entitys.setId(RandomUtil.uuId());
entitys.setInspectionId(entity.getId());
if(isSave){
}else{
}
warehousingInspectionVoucherService.saveOrUpdate(entitys);
}
}
//WarehousingInspectionProduct子表数据新增修改
if(!isSave){
QueryWrapper<WarehousingInspectionProductEntity> WarehousingInspectionProductqueryWrapper = new QueryWrapper<>();
WarehousingInspectionProductqueryWrapper.lambda().eq(WarehousingInspectionProductEntity::getInspectionId, entity.getId());
warehousingInspectionProductService.remove(WarehousingInspectionProductqueryWrapper);
}
if (warehousingInspectionForm.getWarehousingInspectionProductList()!=null){
List<WarehousingInspectionProductEntity> tableField126 = JsonUtil.getJsonToList(warehousingInspectionForm.getWarehousingInspectionProductList(),WarehousingInspectionProductEntity.class);
for(WarehousingInspectionProductEntity entitys : tableField126){
entitys.setId(RandomUtil.uuId());
entitys.setInspectionId(entity.getId());
if(isSave){
}else{
}
warehousingInspectionProductService.saveOrUpdate(entitys);
}
}
//WarehousingInspectionConclusion子表数据新增修改
if(!isSave){
QueryWrapper<WarehousingInspectionConclusionEntity> WarehousingInspectionConclusionqueryWrapper = new QueryWrapper<>();
WarehousingInspectionConclusionqueryWrapper.lambda().eq(WarehousingInspectionConclusionEntity::getInspectionId, entity.getId());
warehousingInspectionConclusionService.remove(WarehousingInspectionConclusionqueryWrapper);
}
if (warehousingInspectionForm.getWarehousingInspectionConclusionList()!=null){
List<WarehousingInspectionConclusionEntity> tableField131 = JsonUtil.getJsonToList(warehousingInspectionForm.getWarehousingInspectionConclusionList(),WarehousingInspectionConclusionEntity.class);
for(WarehousingInspectionConclusionEntity entitys : tableField131){
entitys.setId(RandomUtil.uuId());
entitys.setInspectionId(entity.getId());
if(isSave){
}else{
}
warehousingInspectionConclusionService.saveOrUpdate(entitys);
}
}
}
}

@ -0,0 +1,59 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.WarehousingInspectionVoucherMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.warehousinginspection.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.util.GeneraterSwapUtil;
import jnpf.database.model.superQuery.SuperQueryJsonModel;
import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
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.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* warehousingInspection
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-02-23
*/
@Service
public class WarehousingInspectionVoucherServiceImpl extends ServiceImpl<WarehousingInspectionVoucherMapper, WarehousingInspectionVoucherEntity> implements WarehousingInspectionVoucherService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
//子表过滤方法
@Override
public QueryWrapper<WarehousingInspectionVoucherEntity> getChild(WarehousingInspectionPagination pagination, QueryWrapper<WarehousingInspectionVoucherEntity> warehousingInspectionVoucherQueryWrapper){
boolean pcPermission = true;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String ruleQueryJson = isPc?WarehousingInspectionConstant.getColumnData():WarehousingInspectionConstant.getAppColumnData();
ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson,ColumnDataModel.class);
String ruleJson = isPc?JsonUtil.getObjectToString(dataModel.getRuleList()):JsonUtil.getObjectToString(dataModel.getRuleListApp());
if(isPc){
}
return warehousingInspectionVoucherQueryWrapper;
}
}

@ -0,0 +1,493 @@
package jnpf.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.exception.DataException;
import jnpf.permission.entity.UserEntity;
import jnpf.service.*;
import jnpf.entity.*;
import jnpf.util.*;
import jnpf.model.warehousinginspection.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.web.multipart.MultipartFile;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import java.io.File;
import jnpf.onlinedev.model.ExcelImFieldModel;
import jnpf.onlinedev.model.OnlineImport.ImportDataModel;
import jnpf.onlinedev.model.OnlineImport.ImportFormCheckUniqueModel;
import jnpf.onlinedev.model.OnlineImport.ExcelImportModel;
import jnpf.onlinedev.model.OnlineImport.VisualImportModel;
import cn.xuyanwu.spring.file.storage.FileInfo;
import lombok.Cleanup;
import jnpf.model.visualJson.config.HeaderModel;
import jnpf.base.model.ColumnDataModel;
import jnpf.base.util.VisualUtils;
import org.springframework.transaction.annotation.Transactional;
/**
* warehousingInspection
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-23
*/
@Slf4j
@RestController
@Tag(name = "warehousingInspection" , description = "scm")
@RequestMapping("/api/scm/WarehousingInspection")
public class WarehousingInspectionController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private WarehousingInspectionService warehousingInspectionService;
@Autowired
private WarehousingInspectionVoucherService warehousingInspectionVoucherService;
@Autowired
private WarehousingInspectionProductService warehousingInspectionProductService;
@Autowired
private WarehousingInspectionConclusionService warehousingInspectionConclusionService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
*
* @param warehousingInspectionPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody WarehousingInspectionPagination warehousingInspectionPagination)throws IOException{
List<WarehousingInspectionEntity> list= warehousingInspectionService.getList(warehousingInspectionPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (WarehousingInspectionEntity entity : list) {
QueryWrapper<WarehousingInspectionVoucherEntity> inspectionVoucherEntityQueryWrapper =new QueryWrapper<>();
Map<String, Object> warehousingInspectionMap=JsonUtil.entityToMap(entity);
warehousingInspectionMap.put("id", warehousingInspectionMap.get("id"));
//副表数据
//子表数据
List<WarehousingInspectionVoucherEntity> warehousingInspectionVoucherList = warehousingInspectionService.getWarehousingInspectionVoucherList(entity.getId(),warehousingInspectionPagination);
warehousingInspectionMap.put("tableField118",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingInspectionVoucherList)));
List<WarehousingInspectionProductEntity> warehousingInspectionProductList = warehousingInspectionService.getWarehousingInspectionProductList(entity.getId(),warehousingInspectionPagination);
warehousingInspectionMap.put("tableField126",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingInspectionProductList)));
List<WarehousingInspectionConclusionEntity> warehousingInspectionConclusionList = warehousingInspectionService.getWarehousingInspectionConclusionList(entity.getId(),warehousingInspectionPagination);
warehousingInspectionMap.put("tableField131",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingInspectionConclusionList)));
realList.add(warehousingInspectionMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, WarehousingInspectionConstant.getFormData(), WarehousingInspectionConstant.getColumnData(), warehousingInspectionPagination.getModuleId(),false);
//流程状态添加
for(Map<String, Object> vo:realList){
FlowTaskEntity flowTaskEntity = generaterSwapUtil.getInfoSubmit(String.valueOf(vo.get("id")), FlowTaskEntity::getStatus);
if (flowTaskEntity!=null){
vo.put("flowState",flowTaskEntity.getStatus());
}else{
vo.put("flowState",null);
}
//添加流程id
String flowId="";
if(vo.get("flowid")!=null){
flowId = String.valueOf(vo.get("flowid"));
}
if(vo.get("flowid".toUpperCase())!=null){
flowId = String.valueOf(vo.get("flowid".toUpperCase()));
}
if(StringUtil.isNotEmpty(flowId)){
vo.put("flowId" ,flowId);
}
}
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(warehousingInspectionPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param warehousingInspectionForm
* @return
*/
@PostMapping("/{id}")
@Operation(summary = "创建")
public ActionResult create(@PathVariable("id") String id, @RequestBody @Valid WarehousingInspectionForm warehousingInspectionForm) {
String b = warehousingInspectionService.checkForm(warehousingInspectionForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
warehousingInspectionService.saveOrUpdate(warehousingInspectionForm, id ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody WarehousingInspectionPagination warehousingInspectionPagination) throws IOException {
if (StringUtil.isEmpty(warehousingInspectionPagination.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
List<WarehousingInspectionEntity> list= warehousingInspectionService.getList(warehousingInspectionPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (WarehousingInspectionEntity entity : list) {
Map<String, Object> warehousingInspectionMap=JsonUtil.entityToMap(entity);
warehousingInspectionMap.put("id", warehousingInspectionMap.get("id"));
//副表数据
//子表数据
List<WarehousingInspectionVoucherEntity> warehousingInspectionVoucherList = warehousingInspectionService.getWarehousingInspectionVoucherList(entity.getId(),warehousingInspectionPagination);
warehousingInspectionMap.put("tableField118",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingInspectionVoucherList)));
List<WarehousingInspectionProductEntity> warehousingInspectionProductList = warehousingInspectionService.getWarehousingInspectionProductList(entity.getId(),warehousingInspectionPagination);
warehousingInspectionMap.put("tableField126",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingInspectionProductList)));
List<WarehousingInspectionConclusionEntity> warehousingInspectionConclusionList = warehousingInspectionService.getWarehousingInspectionConclusionList(entity.getId(),warehousingInspectionPagination);
warehousingInspectionMap.put("tableField131",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingInspectionConclusionList)));
realList.add(warehousingInspectionMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, WarehousingInspectionConstant.getFormData(), WarehousingInspectionConstant.getColumnData(), warehousingInspectionPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(warehousingInspectionPagination.getSelectKey())?warehousingInspectionPagination.getSelectKey():new String[0];
UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo);
return ActionResult.success(vo);
}
/**
*
*/
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){
DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>();
if(keys.length>0){
ExcelExportEntity tableField118ExcelEntity = new ExcelExportEntity("","tableField118");
List<ExcelExportEntity> tableField118List = new ArrayList<>();
ExcelExportEntity tableField126ExcelEntity = new ExcelExportEntity("","tableField126");
List<ExcelExportEntity> tableField126List = new ArrayList<>();
ExcelExportEntity tableField131ExcelEntity = new ExcelExportEntity("","tableField131");
List<ExcelExportEntity> tableField131List = new ArrayList<>();
for(String key:keys){
switch(key){
case "inspectionCode" :
entitys.add(new ExcelExportEntity("质检单编号" ,"inspectionCode"));
break;
case "creatorTime" :
entitys.add(new ExcelExportEntity("制单时间" ,"creatorTime"));
break;
case "inspectionType" :
entitys.add(new ExcelExportEntity("质检类型" ,"inspectionType"));
break;
case "belongUserId" :
entitys.add(new ExcelExportEntity("质检人员" ,"belongUserId"));
break;
case "inspectionTime" :
entitys.add(new ExcelExportEntity("质检时间" ,"inspectionTime"));
break;
case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark"));
break;
case "creatorUserId" :
entitys.add(new ExcelExportEntity("创建用户" ,"creatorUserId"));
break;
case "lastModifyTime" :
entitys.add(new ExcelExportEntity("修改时间" ,"lastModifyTime"));
break;
case "lastModifyUserId" :
entitys.add(new ExcelExportEntity("修改用户" ,"lastModifyUserId"));
break;
case "conclusionType" :
entitys.add(new ExcelExportEntity("检测结论" ,"conclusionType"));
break;
case "conclusionRemark" :
entitys.add(new ExcelExportEntity("检验结果" ,"conclusionRemark"));
break;
case "tableField118-voucheId":
tableField118List.add(new ExcelExportEntity("凭证单据编号" ,"voucheId"));
break;
case "tableField126-productId":
tableField126List.add(new ExcelExportEntity("商品名称" ,"productId"));
break;
case "tableField131-grossWeight":
tableField131List.add(new ExcelExportEntity("毛重" ,"grossWeight"));
break;
case "tableField131-tareWeight":
tableField131List.add(new ExcelExportEntity("皮重" ,"tareWeight"));
break;
case "tableField131-buckleWeight":
tableField131List.add(new ExcelExportEntity("扣重" ,"buckleWeight"));
break;
case "tableField131-netWeight":
tableField131List.add(new ExcelExportEntity("净重(自动计算)" ,"netWeight"));
break;
case "tableField131-reduceLevel":
tableField131List.add(new ExcelExportEntity("是否降级" ,"reduceLevel"));
break;
case "tableField131-grade":
tableField131List.add(new ExcelExportEntity("等级" ,"grade"));
break;
case "tableField131-creatorUserId":
tableField131List.add(new ExcelExportEntity("创建用户" ,"creatorUserId"));
break;
default:
break;
}
}
if(tableField118List.size() > 0){
tableField118ExcelEntity.setList(tableField118List);
entitys.add(tableField118ExcelEntity);
}
if(tableField126List.size() > 0){
tableField126ExcelEntity.setList(tableField126List);
entitys.add(tableField126ExcelEntity);
}
if(tableField131List.size() > 0){
tableField131ExcelEntity.setList(tableField131List);
entitys.add(tableField131ExcelEntity);
}
}
ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF);
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){
if (list.size()==0){
list.add(new HashMap<>());
}
//去除空数据
List<Map<String, Object>> dataList = new ArrayList<>();
for (Map<String, Object> map : list) {
int i = 0;
for (String key : keys) {
//子表
if (key.toLowerCase().startsWith("tablefield")) {
String tableField = key.substring(0, key.indexOf("-" ));
String field = key.substring(key.indexOf("-" ) + 1);
Object o = map.get(tableField);
if (o != null) {
List<Map<String, Object>> childList = (List<Map<String, Object>>) o;
for (Map<String, Object> childMap : childList) {
if (childMap.get(field) != null) {
i++;
}
}
}
} else {
Object o = map.get(key);
if (o != null) {
i++;
}
}
}
if (i > 0) {
dataList.add(map);
}
}
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(WarehousingInspectionConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList);
}
String fileName = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) {
log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
}
return vo;
}
/**
*
* @param ids
* @return
*/
@DeleteMapping("/batchRemove")
@Transactional
@Operation(summary = "批量删除")
public ActionResult batchRemove(@RequestBody String ids){
List<String> idList = JsonUtil.getJsonToList(ids, String.class);
List<String> columnIdList = new ArrayList<>(20);
int i =0;
String errInfo = "";
for (String allId : idList){
FlowTaskEntity taskEntity = generaterSwapUtil.getInfoSubmit(allId, FlowTaskEntity::getId, FlowTaskEntity::getStatus);
if (taskEntity==null){
columnIdList.add(allId);
this.delete(allId);
}else if (taskEntity.getStatus().equals(0) || taskEntity.getStatus().equals(4)){
try {
generaterSwapUtil.deleteFlowTask(taskEntity);
columnIdList.add(allId);
this.delete(allId);
i++;
} catch (WorkFlowException e) {
errInfo = e.getMessage();
e.printStackTrace();
}
}
}
if (i == 0 && columnIdList.size()==0){
return ActionResult.fail("流程已发起,无法删除");
}
if (StringUtil.isNotEmpty(errInfo)){
return ActionResult.fail(errInfo);
}
return ActionResult.success("删除成功");
}
/**
*
* @param id
* @param warehousingInspectionForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid WarehousingInspectionForm warehousingInspectionForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
warehousingInspectionForm.setId(id);
if (!isImport) {
String b = warehousingInspectionService.checkForm(warehousingInspectionForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
WarehousingInspectionEntity entity= warehousingInspectionService.getInfo(id);
if(entity!=null){
try{
warehousingInspectionService.saveOrUpdate(warehousingInspectionForm,id,false);
}catch(Exception e){
return ActionResult.fail("修改数据失败");
}
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
WarehousingInspectionEntity entity= warehousingInspectionService.getInfo(id);
if(entity!=null){
FlowTaskEntity taskEntity = generaterSwapUtil.getInfoSubmit(id, FlowTaskEntity::getId, FlowTaskEntity::getStatus);
if (taskEntity != null) {
try {
generaterSwapUtil.deleteFlowTask(taskEntity);
} catch (WorkFlowException e) {
e.printStackTrace();
}
}
//假删除
entity.setDeleteMark(1);
warehousingInspectionService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
WarehousingInspectionEntity entity= warehousingInspectionService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> warehousingInspectionMap=JsonUtil.entityToMap(entity);
warehousingInspectionMap.put("id", warehousingInspectionMap.get("id"));
//副表数据
//子表数据
List<WarehousingInspectionVoucherEntity> warehousingInspectionVoucherList = warehousingInspectionService.getWarehousingInspectionVoucherList(entity.getId());
warehousingInspectionMap.put("tableField118",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingInspectionVoucherList)));
List<WarehousingInspectionProductEntity> warehousingInspectionProductList = warehousingInspectionService.getWarehousingInspectionProductList(entity.getId());
warehousingInspectionMap.put("tableField126",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingInspectionProductList)));
List<WarehousingInspectionConclusionEntity> warehousingInspectionConclusionList = warehousingInspectionService.getWarehousingInspectionConclusionList(entity.getId());
warehousingInspectionMap.put("tableField131",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingInspectionConclusionList)));
warehousingInspectionMap = generaterSwapUtil.swapDataDetail(warehousingInspectionMap,WarehousingInspectionConstant.getFormData(),"530702377393609733",false);
return ActionResult.success(warehousingInspectionMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
WarehousingInspectionEntity entity= warehousingInspectionService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> warehousingInspectionMap=JsonUtil.entityToMap(entity);
warehousingInspectionMap.put("id", warehousingInspectionMap.get("id"));
//副表数据
//子表数据
List<WarehousingInspectionVoucherEntity> warehousingInspectionVoucherList = warehousingInspectionService.getWarehousingInspectionVoucherList(entity.getId());
warehousingInspectionMap.put("warehousingInspectionVoucherList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingInspectionVoucherList)));
List<WarehousingInspectionProductEntity> warehousingInspectionProductList = warehousingInspectionService.getWarehousingInspectionProductList(entity.getId());
warehousingInspectionMap.put("warehousingInspectionProductList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingInspectionProductList)));
List<WarehousingInspectionConclusionEntity> warehousingInspectionConclusionList = warehousingInspectionService.getWarehousingInspectionConclusionList(entity.getId());
warehousingInspectionMap.put("warehousingInspectionConclusionList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(warehousingInspectionConclusionList)));
warehousingInspectionMap = generaterSwapUtil.swapDataForm(warehousingInspectionMap,WarehousingInspectionConstant.getFormData(),WarehousingInspectionConstant.TABLEFIELDKEY,WarehousingInspectionConstant.TABLERENAMES);
return ActionResult.success(warehousingInspectionMap);
}
}

@ -0,0 +1,59 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-23
*/
@Data
@TableName("jg_warehousing_inspection_conclusion")
public class WarehousingInspectionConclusionEntity {
@TableId(value ="ID" )
private String id;
@TableField("INSPECTION_ID")
private String inspectionId;
@TableField(value = "GROSS_WEIGHT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal grossWeight;
@TableField(value = "TARE_WEIGHT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal tareWeight;
@TableField(value = "BUCKLE_WEIGHT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal buckleWeight;
@TableField(value = "NET_WEIGHT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal netWeight;
@TableField("REMARK")
private String remark;
@TableField(value = "REDUCE_LEVEL" , updateStrategy = FieldStrategy.IGNORED)
private String reduceLevel;
@TableField(value = "GRADE" , updateStrategy = FieldStrategy.IGNORED)
private String grade;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@TableField(value = "F_CREATOR_USER_ID" , updateStrategy = FieldStrategy.IGNORED)
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
private String deleteUserId;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
}

@ -0,0 +1,61 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-23
*/
@Data
@TableName("jg_warehousing_inspection")
public class WarehousingInspectionEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "INSPECTION_CODE" , updateStrategy = FieldStrategy.IGNORED)
private String inspectionCode;
@TableField(value = "INSPECTION_TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String inspectionType;
@TableField(value = "BELONG_USER_ID" , updateStrategy = FieldStrategy.IGNORED)
private String belongUserId;
@TableField(value = "INSPECTION_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date inspectionTime;
@TableField("USEDRETURN_STATUS")
private String usedreturnStatus;
@TableField(value = "REMARK" , updateStrategy = FieldStrategy.IGNORED)
private String remark;
@TableField(value = "CONCLUSION_TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String conclusionType;
@TableField(value = "CONCLUSION_REMARK" , updateStrategy = FieldStrategy.IGNORED)
private String conclusionRemark;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
private String deleteUserId;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("F_VERSION")
private Integer version;
@TableField("F_FLOW_TASK_ID")
private String flowTaskId;
@TableField("F_FLOW_ID")
private String flowId;
}

@ -0,0 +1,45 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-23
*/
@Data
@TableName("jg_warehousing_inspection_product")
public class WarehousingInspectionProductEntity {
@TableId(value ="ID" )
private String id;
@TableField("INSPECTION_ID")
private String inspectionId;
@TableField("VOUCHE_ID")
private String voucheId;
@TableField(value = "PRODUCT_ID" , updateStrategy = FieldStrategy.IGNORED)
private String productId;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
private String deleteUserId;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
}

@ -0,0 +1,43 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-23
*/
@Data
@TableName("jg_warehousing_inspection_voucher")
public class WarehousingInspectionVoucherEntity {
@TableId(value ="ID" )
private String id;
@TableField("INSPECTION_ID")
private String inspectionId;
@TableField(value = "VOUCHE_ID" , updateStrategy = FieldStrategy.IGNORED)
private String voucheId;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
private String deleteUserId;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
}

@ -0,0 +1,43 @@
package jnpf.model.warehousinginspection;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* warehousingInspection
* V3.5
* : https://www.jnpfsoft.com
* JNPF
* 2024-02-23
*/
@Data
public class WarehousingInspectionConclusionModel {
/** 毛重 **/
@JSONField(name = "grossWeight")
private String grossWeight;
/** 皮重 **/
@JSONField(name = "tareWeight")
private String tareWeight;
/** 扣重 **/
@JSONField(name = "buckleWeight")
private String buckleWeight;
/** 净重(自动计算) **/
@JSONField(name = "netWeight")
private String netWeight;
/** 是否降级 **/
@JSONField(name = "reduceLevel")
private Object reduceLevel;
/** 等级 **/
@JSONField(name = "grade")
private String grade;
/** 创建用户 **/
@JSONField(name = "creatorUserId")
private String creatorUserId;
}

@ -0,0 +1,68 @@
package jnpf.model.warehousinginspection;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* warehousingInspection
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-23
*/
@Data
public class WarehousingInspectionForm {
/** 主键 */
private String id;
/** 子表数据 **/
@JsonProperty("warehousingInspectionVoucherList")
private List<WarehousingInspectionVoucherModel> warehousingInspectionVoucherList;
/** 子表数据 **/
@JsonProperty("warehousingInspectionProductList")
private List<WarehousingInspectionProductModel> warehousingInspectionProductList;
/** 子表数据 **/
@JsonProperty("warehousingInspectionConclusionList")
private List<WarehousingInspectionConclusionModel> warehousingInspectionConclusionList;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 流程id **/
@JsonProperty("flowId")
private String flowId;
/** 质检单编号 **/
@JsonProperty("inspectionCode")
private String inspectionCode;
/** 制单时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
/** 质检类型 **/
@JsonProperty("inspectionType")
private Object inspectionType;
/** 质检人员 **/
@JsonProperty("belongUserId")
private Object belongUserId;
/** 质检时间 **/
@JsonProperty("inspectionTime")
private String inspectionTime;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 创建用户 **/
@JsonProperty("creatorUserId")
private String creatorUserId;
/** 修改时间 **/
@JsonProperty("lastModifyTime")
private String lastModifyTime;
/** 修改用户 **/
@JsonProperty("lastModifyUserId")
private String lastModifyUserId;
/** 检测结论 **/
@JsonProperty("conclusionType")
private Object conclusionType;
/** 检验结果 **/
@JsonProperty("conclusionRemark")
private String conclusionRemark;
}

@ -0,0 +1,45 @@
package jnpf.model.warehousinginspection;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* warehousingInspection
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-02-23
*/
@Data
public class WarehousingInspectionPagination extends Pagination {
/** 查询key */
private String[] selectKey;
/** json */
private String json;
/** 数据类型 0-当前页1-全部数据 */
private String dataType;
/** 高级查询 */
private String superQueryJson;
/** 功能id */
private String moduleId;
/** 菜单id */
private String menuId;
/** 质检单编号 */
@JsonProperty("inspectionCode")
private Object inspectionCode;
/** 制单时间 */
@JsonProperty("creatorTime")
private Object creatorTime;
/** 质检类型 */
@JsonProperty("inspectionType")
private Object inspectionType;
/** 质检人员 */
@JsonProperty("belongUserId")
private Object belongUserId;
/** 质检时间 */
@JsonProperty("inspectionTime")
private Object inspectionTime;
}

@ -0,0 +1,24 @@
package jnpf.model.warehousinginspection;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* warehousingInspection
* V3.5
* : https://www.jnpfsoft.com
* JNPF
* 2024-02-23
*/
@Data
public class WarehousingInspectionProductModel {
/** 商品名称 **/
@JSONField(name = "productId")
private String productId;
}

@ -0,0 +1,24 @@
package jnpf.model.warehousinginspection;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* warehousingInspection
* V3.5
* : https://www.jnpfsoft.com
* JNPF
* 2024-02-23
*/
@Data
public class WarehousingInspectionVoucherModel {
/** 凭证单据编号 **/
@JSONField(name = "voucheId")
private String voucheId;
}

@ -0,0 +1,2 @@
const columnList = [{"jnpfKey":"billRule","fullName":"质检单编号","label":"质检单编号","sortable":false,"align":"left","__config__":{"formId":102,"visibility":["pc","app"],"jnpfKey":"billRule","defaultValue":null,"noShow":false,"tipLabel":"","dragDisabled":false,"rule":"warehousingInspection","className":[],"label":"质检单编号","trigger":"change","showLabel":true,"required":false,"tableName":"jg_warehousing_inspection","renderKey":1708665599300,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-documents","ruleName":"质检单","tag":"JnpfInput","span":10},"readonly":true,"prop":"inspectionCode","width":0,"__vModel__":"inspectionCode","fixed":"none","style":{"width":"100%"},"id":"inspectionCode","placeholder":"系统自动生成"},{"jnpfKey":"createTime","fullName":"制单时间","label":"制单时间","sortable":false,"align":"left","type":"currTime","__config__":{"formId":103,"visibility":["pc","app"],"jnpfKey":"createTime","defaultValue":"","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"制单时间","showLabel":true,"required":false,"tableName":"jg_warehousing_inspection","renderKey":1708665647691,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-createtime","tag":"JnpfOpenData","span":10},"readonly":true,"prop":"creatorTime","width":0,"__vModel__":"creatorTime","fixed":"none","style":{"width":"100%"},"id":"creatorTime","placeholder":""},{"filterable":false,"clearable":true,"jnpfKey":"select","multiple":false,"fullName":"质检类型","label":"质检类型","sortable":false,"align":"left","props":{"label":"fullName","value":"id"},"__config__":{"formId":113,"visibility":["pc","app"],"jnpfKey":"select","defaultValue":"","noShow":false,"dataType":"static","dictionaryType":"","tipLabel":"","dragDisabled":false,"className":[],"label":"质检类型","trigger":"change","propsUrl":"","templateJson":[],"showLabel":true,"required":true,"tableName":"jg_warehousing_inspection","renderKey":1708665744875,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-select","propsName":"","tag":"JnpfSelect","regList":[],"span":8},"prop":"inspectionType","width":0,"options":[{"fullName":"入库质检","id":"1"},{"fullName":"出库质检","id":"2"}],"__vModel__":"inspectionType","fixed":"none","style":{"width":"100%"},"disabled":false,"interfaceHasPage":false,"id":"inspectionType","placeholder":"请选择","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"jnpfKey":"userSelect","ableIds":[],"multiple":false,"fullName":"质检人员","label":"质检人员","sortable":false,"align":"left","relationField":"","__config__":{"formId":114,"visibility":["pc","app"],"jnpfKey":"userSelect","defaultValue":null,"noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"质检人员","trigger":"change","showLabel":true,"required":true,"relationField":"","tableName":"jg_warehousing_inspection","renderKey":1708665776213,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-user","defaultCurrent":false,"tag":"JnpfUserSelect","regList":[],"span":8},"prop":"belongUserId","width":0,"__vModel__":"belongUserId","fixed":"none","style":{"width":"100%"},"selectType":"all","disabled":false,"id":"belongUserId","placeholder":"请选择","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"jnpfKey":"datePicker","format":"yyyy-MM-dd HH:mm","fullName":"质检时间","label":"质检时间","sortable":false,"align":"left","type":"datetime","__config__":{"endRelationField":"","defaultValue":"","dragDisabled":false,"className":[],"showLabel":true,"required":true,"tableName":"jg_warehousing_inspection","renderKey":1708665793517,"tagIcon":"icon-ym icon-ym-generator-date","startRelationField":"","defaultCurrent":false,"tag":"JnpfDatePicker","formId":115,"visibility":["pc","app"],"jnpfKey":"datePicker","noShow":false,"endTimeTarget":1,"tipLabel":"","startTimeType":1,"endTimeRule":false,"label":"质检时间","startTimeRule":false,"startTimeValue":"","trigger":"change","endTimeValue":"","endTimeType":1,"layout":"colFormItem","startTimeTarget":1,"regList":[],"span":8},"readonly":false,"prop":"inspectionTime","width":0,"__vModel__":"inspectionTime","fixed":"none","style":{"width":"100%"},"disabled":false,"startTime":null,"id":"inspectionTime","placeholder":"请选择","endTime":null,"on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}]
export default columnList

@ -0,0 +1,818 @@
<template>
<div :style="{margin: '0 auto',width:'100%'}">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
label-position="right" :disabled="setting.readonly">
<template v-if="!loading && formOperates">
<!-- 具体表单 -->
<el-col :span="24">
<jnpf-form-tip-item>
<JnpfGroupTitle content="基础信息" contentPosition="left">
</JnpfGroupTitle>
</jnpf-form-tip-item>
</el-col>
<el-col :span="10" v-if="judgeShow('inspectionCode')">
<jnpf-form-tip-item label="质检单编号" v-if="judgeShow('inspectionCode')"
prop="inspectionCode">
<JnpfInput v-model="dataForm.inspectionCode" @change="changeData('inspectionCode',-1)"
placeholder="系统自动生成" :disabled="judgeWrite('inspectionCode')" readonly
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="10" v-if="judgeShow('creatorTime')">
<jnpf-form-tip-item label="制单时间" v-if="judgeShow('creatorTime')" prop="creatorTime">
<JnpfOpenData v-model="dataForm.creatorTime" @change="changeData('creatorTime',-1)"
placeholder="系统自动生成" :disabled="judgeWrite('creatorTime')" readonly
:style='{"width":"100%"}' type="currTime">
</JnpfOpenData>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('inspectionType')">
<jnpf-form-tip-item label="质检类型" v-if="judgeShow('inspectionType')"
prop="inspectionType">
<JnpfSelect v-model="dataForm.inspectionType"
@change="changeData('inspectionType',-1)" placeholder="请选择"
:disabled="judgeWrite('inspectionType')" clearable :style='{"width":"100%"}'
:options="inspectionTypeOptions" :props="inspectionTypeProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('belongUserId')">
<jnpf-form-tip-item label="质检人员" v-if="judgeShow('belongUserId')" prop="belongUserId">
<JnpfUserSelect v-model="dataForm.belongUserId"
@change="changeData('belongUserId',-1)" placeholder="请选择" selectType="all"
:ableIds="ableAll.belongUserIdableIds" :disabled="judgeWrite('belongUserId')"
clearable :style='{"width":"100%"}'>
</JnpfUserSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('inspectionTime')">
<jnpf-form-tip-item label="质检时间" v-if="judgeShow('inspectionTime')"
prop="inspectionTime">
<JnpfDatePicker v-model="dataForm.inspectionTime"
@change="changeData('inspectionTime',-1)" :startTime="dateTime(false,1,1,'','')"
:endTime="dateTime(false,1,1,'','')" placeholder="请选择"
:disabled="judgeWrite('inspectionTime')" clearable :style='{"width":"100%"}'
type="datetime" format="yyyy-MM-dd HH:mm">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('remark')">
<jnpf-form-tip-item label="备注" v-if="judgeShow('remark')" prop="remark">
<JnpfInput v-model="dataForm.remark" @change="changeData('remark',-1)"
placeholder="请输入" :disabled="judgeWrite('remark')" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item>
<JnpfGroupTitle content="关联信息" contentPosition="left">
</JnpfGroupTitle>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('-${html.relationField}')">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.warehousinginspectionvoucherList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="凭证单据编号"
v-if="judgeShow('warehousinginspectionvoucher-voucheId')" prop="voucheId">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousinginspectionvoucherList-voucheId')">*</span>凭证单据编号
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.voucheId"
@change="changeData('warehousinginspectionvoucher-voucheId',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.warehousinginspectionvouchervoucheId"
placeholder="请选择"
:disabled="judgeWrite('warehousinginspectionvoucherList')||judgeWrite('warehousinginspectionvoucherList-voucheId')"
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='voucher_code' :field="'voucheId'+scope.$index"
interfaceId="530709323597241349" :pageSize="20"
:columnOptions="warehousinginspectionvouchervoucheIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="操作" width="50"
v-if="!judgeWrite('warehousinginspectionvoucherList')">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delwarehousinginspectionvoucherList(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addwarehousinginspectionvoucherList()"
v-if="!judgeWrite('warehousinginspectionvoucherList')">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item>
<JnpfGroupTitle content="商品数据" contentPosition="left">
</JnpfGroupTitle>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('warehousinginspectionvoucher-voucher_code')">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.warehousinginspectionproductList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="商品名称"
v-if="judgeShow('warehousinginspectionproduct-productId')" prop="productId">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousinginspectionproductList-productId')">*</span>商品名称
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.productId"
@change="changeData('warehousinginspectionproduct-productId',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.warehousinginspectionproductproductId"
placeholder="请选择"
:disabled="judgeWrite('warehousinginspectionproductList')||judgeWrite('warehousinginspectionproductList-productId')"
hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='name' :field="'productId'+scope.$index"
interfaceId="530714636022995973" :pageSize="20"
:columnOptions="warehousinginspectionproductproductIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="操作" width="50"
v-if="!judgeWrite('warehousinginspectionproductList')">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delwarehousinginspectionproductList(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addwarehousinginspectionproductList()"
v-if="!judgeWrite('warehousinginspectionproductList')">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item>
<JnpfGroupTitle content="检测结论" contentPosition="left">
</JnpfGroupTitle>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('warehousinginspectionproduct-name')">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.warehousinginspectionconclusionList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="毛重"
v-if="judgeShow('warehousinginspectionconclusion-grossWeight')"
prop="grossWeight">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousinginspectionconclusionList-grossWeight')">*</span>毛重
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.grossWeight"
@change="changeData('warehousinginspectionconclusion-grossWeight',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('warehousinginspectionconclusionList')||judgeWrite('warehousinginspectionconclusionList-grossWeight')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="皮重"
v-if="judgeShow('warehousinginspectionconclusion-tareWeight')" prop="tareWeight">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousinginspectionconclusionList-tareWeight')">*</span>皮重
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.tareWeight"
@change="changeData('warehousinginspectionconclusion-tareWeight',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('warehousinginspectionconclusionList')||judgeWrite('warehousinginspectionconclusionList-tareWeight')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="扣重"
v-if="judgeShow('warehousinginspectionconclusion-buckleWeight')"
prop="buckleWeight">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousinginspectionconclusionList-buckleWeight')">*</span>扣重
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.buckleWeight"
@change="changeData('warehousinginspectionconclusion-buckleWeight',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('warehousinginspectionconclusionList')||judgeWrite('warehousinginspectionconclusionList-buckleWeight')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="净重(自动计算)"
v-if="judgeShow('warehousinginspectionconclusion-netWeight')" prop="netWeight">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousinginspectionconclusionList-netWeight')">*</span>净重(自动计算)
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.netWeight"
@change="changeData('warehousinginspectionconclusion-netWeight',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('warehousinginspectionconclusionList')||judgeWrite('warehousinginspectionconclusionList-netWeight')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="是否降级"
v-if="judgeShow('warehousinginspectionconclusion-reduceLevel')"
prop="reduceLevel">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousinginspectionconclusionList-reduceLevel')">*</span>是否降级
</template>
<template slot-scope="scope">
<JnpfSelect v-model="scope.row.reduceLevel"
@change="changeData('warehousinginspectionconclusion-reduceLevel',scope.$index)"
placeholder="请选择"
:disabled="judgeWrite('warehousinginspectionconclusionList')||judgeWrite('warehousinginspectionconclusionList-reduceLevel')"
clearable :style='{"width":"100%"}'
:options="warehousinginspectionconclusionreduceLevelOptions"
:props="warehousinginspectionconclusionreduceLevelProps">
</JnpfSelect>
</template>
</el-table-column>
<el-table-column label="等级"
v-if="judgeShow('warehousinginspectionconclusion-grade')" prop="grade">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousinginspectionconclusionList-grade')">*</span>等级
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.grade"
@change="changeData('warehousinginspectionconclusion-grade',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('warehousinginspectionconclusionList')||judgeWrite('warehousinginspectionconclusionList-grade')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="创建用户"
v-if="judgeShow('warehousinginspectionconclusion-creatorUserId')"
prop="creatorUserId">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('warehousinginspectionconclusionList-creatorUserId')">*</span>创建用户
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.creatorUserId"
@change="changeData('warehousinginspectionconclusion-creatorUserId',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('warehousinginspectionconclusionList')||judgeWrite('warehousinginspectionconclusionList-creatorUserId')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="操作" width="50"
v-if="!judgeWrite('warehousinginspectionconclusionList')">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delwarehousinginspectionconclusionList(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addwarehousinginspectionconclusionList()"
v-if="!judgeWrite('warehousinginspectionconclusionList')">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('conclusionType')">
<jnpf-form-tip-item label="检测结论" v-if="judgeShow('conclusionType')"
prop="conclusionType">
<JnpfSelect v-model="dataForm.conclusionType"
@change="changeData('conclusionType',-1)" placeholder="请选择"
:disabled="judgeWrite('conclusionType')" clearable :style='{"width":"100%"}'
:options="conclusionTypeOptions" :props="conclusionTypeProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('conclusionRemark')">
<jnpf-form-tip-item label="检验结果" v-if="judgeShow('conclusionRemark')"
prop="conclusionRemark">
<JnpfInput v-model="dataForm.conclusionRemark"
@change="changeData('conclusionRemark',-1)" placeholder="请输入"
:disabled="judgeWrite('conclusionRemark')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false" />
</el-form>
</el-row>
<UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
</div>
</template>
<script>
import request from '@/utils/request'
import { mapGetters } from "vuex";
import { getFormById } from '@/api/workFlow/FormDesign'
import comMixin from '@/views/workFlow/workFlowForm/mixin';
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
mixins: [comMixin],
components: {},
props: [],
data() {
return {
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
prevDis: false,
nextDis: false,
allList: [],
visible: false,
loading: false,
btnLoading: false,
formRef: 'formRef',
setting: {},
eventType: '',
userBoxVisible: false,
selectDialogVisible: false,
currTableConf: {},
dataValueAll: {},
addTableConf: {
warehousinginspectionvoucherList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
warehousinginspectionproductList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
warehousinginspectionconclusionList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
},
//
ableAll: {
},
tableRows: {
warehousinginspectionvoucherList: {
voucheId: '',
voucheIdOptions: [],
enabledmark: undefined
},
warehousinginspectionproductList: {
productId: '',
productIdOptions: [],
enabledmark: undefined
},
warehousinginspectionconclusionList: {
grossWeight: '',
grossWeightOptions: [],
tareWeight: '',
tareWeightOptions: [],
buckleWeight: '',
buckleWeightOptions: [],
netWeight: '',
netWeightOptions: [],
reduceLevelOptions: [],
grade: '',
gradeOptions: [],
creatorUserId: '',
creatorUserIdOptions: [],
enabledmark: undefined
},
},
Vmodel: "",
currVmodel: "",
dataForm: {
inspectionCode: undefined,
creatorTime: undefined,
inspectionType: undefined,
belongUserId: undefined,
inspectionTime: undefined,
remark: undefined,
creatorUserId: undefined,
lastModifyTime: undefined,
lastModifyUserId: undefined,
conclusionType: undefined,
conclusionRemark: undefined,
warehousinginspectionvoucherList: [],
warehousinginspectionproductList: [],
warehousinginspectionconclusionList: [],
version: 0,
},
tableRequiredData: {},
dataRule:
{
inspectionType: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
belongUserId: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
inspectionTime: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
conclusionType: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
},
inspectionTypeOptions: [{ "fullName": "入库质检", "id": "1" }, { "fullName": "出库质检", "id": "2" }],
inspectionTypeProps: { "label": "fullName", "value": "id" },
conclusionTypeOptions: [{ "fullName": "合格", "id": "1" }, { "fullName": "不合格", "id": "2" }],
conclusionTypeProps: { "label": "fullName", "value": "id" },
warehousinginspectionvouchervoucheIdcolumnOptions: [{ "label": "凭证编号", "value": "voucher_code" }, { "label": "单据类型", "value": "documentTypes" }, { "label": "凭证类型", "value": "voucherTypes" }, { "label": "车辆信息", "value": "vehicle_number" },],
warehousinginspectionproductproductIdcolumnOptions: [{ "label": "商品名称", "value": "name" }, { "label": "规格", "value": "spec" },],
warehousinginspectionconclusionreduceLevelOptions: [{ "fullName": "是", "id": "1" }, { "fullName": "否", "id": "2" }],
warehousinginspectionconclusionreduceLevelProps: { "label": "fullName", "value": "id" },
childIndex: -1,
isEdit: false,
interfaceRes: {
inspectionCode: [],
creatorTime: [],
inspectionType: [],
belongUserId: [],
inspectionTime: [],
remark: [],
creatorUserId: [],
lastModifyTime: [],
lastModifyUserId: [],
conclusionType: [],
conclusionRemark: [],
warehousinginspectionvouchervoucheId: [{ "fieldName": "这是质检单的类型", "field": "inspectionType", "defaultValue": "", "jnpfKey": "select", "dataType": "varchar", "id": "q3dbiy1", "relationField": "inspectionType", "required": "1" }],
warehousinginspectionproductproductId: [{ "fieldName": "根据凭证带出的商品进行查询", "field": "product", "defaultValue": "", "jnpfKey": "billRule", "dataType": "varchar", "id": "rBzgiy1", "relationField": "inspectionCode", "required": "1" }],
warehousinginspectionconclusiongrossWeight: [],
warehousinginspectionconclusiontareWeight: [],
warehousinginspectionconclusionbuckleWeight: [],
warehousinginspectionconclusionnetWeight: [],
warehousinginspectionconclusionreduceLevel: [],
warehousinginspectionconclusiongrade: [],
warehousinginspectionconclusioncreatorUserId: [],
},
}
},
computed: {
formOperates() {
return this.setting.formOperates
}
},
watch: {},
created() {
this.getFormById()
if (this.dataForm.id == null || this.dataForm.id == '' && this.dataForm.id == undefined || this.dataForm.id == 0) {
this.initDefaultData()
}
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() { },
methods: {
changeData(model, index) {
this.isEdit = false
this.childIndex = index
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key]
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
if (this[options]) {
this[options]()
}
this.changeData(key, index)
}
}
}
}
},
changeDataFormData(type, data, model, index, defaultValue) {
if (!this.isEdit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue
}
}
} else {
this.dataForm[data] = defaultValue
}
}
},
dataAll() {
},
selfGetInfo(dataForm) {
this.dataInfo(dataForm)
},
beforeSubmit() {
const _data = this.dataList()
return _data
},
selfInit() {
this.dataAll()
},
getFormById() {
getFormById("530702377393609733").then(res => {
this.dataForm.flowId = res.data && res.data.flowId
// this.encode = res.data&&res.data.encode
})
},
exist() {
let isOk = true
for (let key in this.tableRequiredData) {
if (this.dataForm[key] && Array.isArray(this.dataForm[key])) {
for (let i = 0; i < this.dataForm[key].length; i++) {
let item = this.dataForm[key][i]
inner: for (let id in item) {
let arr = this.tableRequiredData[key].filter(o => o.id === id) || []
if (!arr.length) continue inner
if (arr[0].required) {
let msg = `${arr[0].name}不能为空`
let boo = true
if (arr[0].dataType === 'array') {
boo = !this.jnpf.isEmptyArray(item[id])
} else {
boo = !this.jnpf.isEmpty(item[id])
}
if (!boo) {
this.$message({
message: msg,
type: 'error',
duration: 1000
})
isOk = false
break
}
}
}
}
}
}
if (!this.warehousinginspectionvoucherExist()) return
if (!this.warehousinginspectionproductExist()) return
if (!this.warehousinginspectionconclusionExist()) return
return isOk
},
warehousinginspectionvoucherExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.warehousinginspectionvoucherList.length; i++) {
const e = this.dataForm.warehousinginspectionvoucherList[i];
if (!e.voucheId) {
this.$message({
message: '凭证单据编号不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
}
return isOk;
},
warehousinginspectionproductExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.warehousinginspectionproductList.length; i++) {
const e = this.dataForm.warehousinginspectionproductList[i];
if (!e.productId) {
this.$message({
message: '商品名称不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
}
return isOk;
},
warehousinginspectionconclusionExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.warehousinginspectionconclusionList.length; i++) {
const e = this.dataForm.warehousinginspectionconclusionList[i];
}
return isOk;
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
//
initDefaultData() {
},
addwarehousinginspectionvoucherList() {
let item = {
voucheId: '',
}
this.getwarehousinginspectionvoucherList(item)
},
delwarehousinginspectionvoucherList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.warehousinginspectionvoucherList.splice(index, 1);
}).catch(() => {
});
},
getwarehousinginspectionvoucherList(value) {
let item = { ...this.tableRows.warehousinginspectionvoucherList, ...value }
this.dataForm.warehousinginspectionvoucherList.push(item)
this.childIndex = this.dataForm.warehousinginspectionvoucherList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
},
addwarehousinginspectionproductList() {
let item = {
productId: '',
}
this.getwarehousinginspectionproductList(item)
},
delwarehousinginspectionproductList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.warehousinginspectionproductList.splice(index, 1);
}).catch(() => {
});
},
getwarehousinginspectionproductList(value) {
let item = { ...this.tableRows.warehousinginspectionproductList, ...value }
this.dataForm.warehousinginspectionproductList.push(item)
this.childIndex = this.dataForm.warehousinginspectionproductList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
},
addwarehousinginspectionconclusionList() {
let item = {
grossWeight: undefined,
tareWeight: undefined,
buckleWeight: undefined,
netWeight: undefined,
reduceLevel: '',
grade: undefined,
creatorUserId: undefined,
}
this.getwarehousinginspectionconclusionList(item)
},
delwarehousinginspectionconclusionList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.warehousinginspectionconclusionList.splice(index, 1);
}).catch(() => {
});
},
getwarehousinginspectionconclusionList(value) {
let item = { ...this.tableRows.warehousinginspectionconclusionList, ...value }
this.dataForm.warehousinginspectionconclusionList.push(item)
this.childIndex = this.dataForm.warehousinginspectionconclusionList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key]
this.currVmodel = key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if (this['get' + this.currVmodel]) {
this['get' + this.currVmodel](t)
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = new Date().getTime()
} else if (timeType == 4) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
}
} else if (timeType == 5) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
let timeDataValue = null
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00'
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue
} else {
timeDataValue = timeDataValue + ':00'
}
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
}
}
return timeDataValue;
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
for (let i = 0; i < _dataAll.warehousinginspectionvoucherList.length; i++) {
this.childIndex = i
}
for (let i = 0; i < _dataAll.warehousinginspectionproductList.length; i++) {
this.childIndex = i
}
for (let i = 0; i < _dataAll.warehousinginspectionconclusionList.length; i++) {
this.childIndex = i
}
this.childIndex = -1
},
},
}
</script>

@ -0,0 +1,605 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="质检单编号">
<el-input v-model="query.inspectionCode" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="制单时间">
<JnpfDateRangePicker v-model="query.creatorTime" format="yyyy-MM-dd"
startPlaceholder="开始日期" endPlaceholder="结束日期" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="质检类型">
<JnpfSelect v-model="query.inspectionType" placeholder="请选择" clearable
:options="inspectionTypeOptions" :props="inspectionTypeProps" multiple>
</JnpfSelect>
</el-form-item>
</el-col>
<template v-if="showAll">
<el-col :span="6">
<el-form-item label="质检人员">
<JnpfUserSelect selectType="all" v-model="query.belongUserId" placeholder="请选择"
clearable multiple />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="质检时间">
<JnpfDateRangePicker v-model="query.inspectionTime" format="yyyy-MM-dd HH:mm"
startPlaceholder="开始日期" endPlaceholder="结束日期">
</JnpfDateRangePicker>
</el-form-item>
</el-col>
</template>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
<el-button type="text" icon="el-icon-arrow-down" @click="showAll=true"
v-if="!showAll">
展开
</el-button>
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
收起
</el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'"
@click="addOrUpdateHandle()">新增
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-download" @click="exportData()"
v-has="'btn_download'">导出
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-clearn" @click="handleBatchRemoveDel()"
v-has="'btn_batchRemove'">批量删除
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true">
<el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false"
@click="openSuperQuery()" />
</el-tooltip>
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="initData()" />
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
@selection-change="handleSelectionChange" :span-method="arraySpanMethod">
<el-table-column prop="inspectionCode" label="质检单编号" align="left">
</el-table-column>
<el-table-column prop="creatorTime" label="制单时间" align="left">
</el-table-column>
<el-table-column label="质检类型" prop="inspectionType" algin="left">
<template slot-scope="scope">
{{ scope.row.inspectionType}}
</template>
</el-table-column>
<el-table-column prop="belongUserId" label="质检人员" align="left">
</el-table-column>
<el-table-column prop="inspectionTime" label="质检时间" align="left">
</el-table-column>
<el-table-column prop="flowState" label="状态" width="100">
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag v-if="scope.row.flowState==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.flowState==2">审核通过</el-tag>
<el-tag type="danger" v-else-if="scope.row.flowState==3">审核驳回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==4">流程撤回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==5">审核终止</el-tag>
<el-tag type="warning" v-else></el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="updateHandle(scope.row)" v-has="'btn_edit'">编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn"
:disabled="[1,2,3,5].indexOf(scope.row.flowState)>-1" v-has="'btn_remove'"
@click="handleDel(scope.row.id)">删除
</el-button>
<el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="updateHandle(scope.row,scope.row.flowState)">详情</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage"
:limit.sync="listQuery.pageSize" @pagination="initData" />
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<FlowBox v-if="flowVisible" ref="FlowBox" @close="colseFlow" />
<el-dialog title="请选择流程" :close-on-click-modal="false" append-to-body
:visible.sync="flowListVisible" class="JNPF-dialog template-dialog JNPF-dialog_center"
lock-scroll width="400px">
<el-scrollbar class="template-list">
<div class="template-item" v-for="item in flowList" :key="item.id"
@click="selectFlow(item)">{{item.fullName}}
</div>
</el-scrollbar>
</el-dialog>
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail"
@close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson"
@superQuery="superQuery" />
</div>
</template>
<script>
import request from '@/utils/request'
import { mapGetters } from "vuex";
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getFormById } from '@/api/workFlow/FormDesign'
import { getFlowList } from '@/api/workFlow/FlowEngine'
import FlowBox from '@/views/workFlow/components/FlowBox'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getConfigData } from '@/api/onlineDev/visualDev'
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
export default {
components: {
FlowBox,
ExportBox, ToFormDetail, SuperQuery
},
data() {
return {
keyword: '',
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
columnList,
showAll: false,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
inspectionCode: undefined,
creatorTime: undefined,
inspectionType: undefined,
belongUserId: undefined,
inspectionTime: undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id',
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
multipleSelection: [], total: 0,
queryData: {},
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
formVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
inspectionTypeOptions: [{ "fullName": "入库质检", "id": "1" }, { "fullName": "出库质检", "id": "2" }],
inspectionTypeProps: { "label": "fullName", "value": "id" },
conclusionTypeOptions: [{ "fullName": "合格", "id": "1" }, { "fullName": "不合格", "id": "2" }],
conclusionTypeProps: { "label": "fullName", "value": "id" },
tableField118_voucheIdcolumnOptions: [{ "label": "凭证编号", "value": "voucher_code" }, { "label": "单据类型", "value": "documentTypes" }, { "label": "凭证类型", "value": "voucherTypes" }, { "label": "车辆信息", "value": "vehicle_number" },],
tableField126_productIdcolumnOptions: [{ "label": "商品名称", "value": "name" }, { "label": "规格", "value": "spec" },],
tableField131_reduceLevelOptions: [{ "fullName": "是", "id": "1" }, { "fullName": "否", "id": "2" }],
tableField131_reduceLevelProps: { "label": "fullName", "value": "id" },
interfaceRes: {
tableField118_voucheId: [{ "fieldName": "这是质检单的类型", "field": "inspectionType", "defaultValue": "", "jnpfKey": "select", "dataType": "varchar", "id": "q3dbiy1", "relationField": "inspectionType", "required": "1" }],
tableField126_productId: [{ "fieldName": "这是质检单的类型", "field": "inspectionType", "defaultValue": "", "jnpfKey": "billRule", "dataType": "int", "id": "q3dbiy1", "relationField": "inspectionCode", "required": "1" }],
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
getFormById("530702377393609733").then(res1 => {
let flowId = res1.data && res1.data.id
getFlowList(flowId, '1').then(res2 => {
this.flowList = res2.data
this.getColumnList(),
this.initSearchDataAndListData()
this.queryData = JSON.parse(JSON.stringify(this.query))
}).catch((e) => {
this.$message({ type: 'error', message: e.message });
this.$router.push('/404');
})
})
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.toFormDetailVisible = true
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
},
toggleTreeExpand(expands) {
this.refreshTree = false
this.expandsTree = expands
this.$nextTick(() => {
this.refreshTree = true
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null)
})
})
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data
const config = {
treeInterfaceId: "",
treeTemplateJson: []
}
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || ''
}
}
//
let query = {
paramList: config.treeTemplateJson || [],
}
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
})
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList)
},
transformColumnList(columnList) {
let list = []
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e)
} else {
let prop = e.prop.split('-')[0]
let label = e.label.split('-')[0]
let vModel = e.prop.split('-')[1]
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
}
e.vModel = vModel
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
if (!list.some(o => o.prop === prop)) list.push(newItem)
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e)
break
}
}
}
}
this.getMergeList(list)
this.getExportList(list)
return list
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list))
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + '-child-first'
}
item.children.unshift(child)
}
})
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
})
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
})
}
})
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
})
}
})
},
getExportList(list) {
let exportList = []
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === 'table') {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j])
}
} else {
exportList.push(list[i])
}
}
this.exportList = exportList
},
goDetail(id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({ column, prop, order }) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
},
//
async initSearchData() {
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: '530702377393609733',
type: 1,
};
request({
url: `/api/scm/WarehousingInspection/getList`,
method: 'post',
data: _query
}).then(res => {
var _list = res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj,
}))
this.total = res.data.pagination.total
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/scm/WarehousingInspection/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
});
},
handelUpload() {
this.uploadBoxVisible = true
this.$nextTick(() => {
this.$refs.UploadBox.init("", "scm/WarehousingInspection")
})
},
handleSelectionChange(val) {
const res = val.map(item => item.id)
this.multipleSelection = res
},
handleBatchRemoveDel() {
if (!this.multipleSelection.length) {
this.$message({
type: 'error',
message: '请选择一条数据',
duration: 1500,
})
return
}
const ids = this.multipleSelection
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/scm/WarehousingInspection/batchRemove`,
data: ids,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
})
},
openSuperQuery() {
this.superQueryVisible = true
this.$nextTick(() => {
this.$refs.SuperQuery.init()
})
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson
this.listQuery.currentPage = 1
this.initData()
},
addOrUpdateHandle(row, flowState) {
if (!row) {
this.addHandle();
} else {
this.updateHandle(row, flowState)
}
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList)
})
},
download(data) {
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
request({
url: `/api/scm/WarehousingInspection/Actions/Export`,
method: 'post',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.initData()
},
//
updateHandle(row, flowState) {
let data = {
id: row.id,
flowId: row.flowId || this.flowList[0].id,
opType: flowState ? 0 : '-1',
status: flowState
}
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
toApprovalDetail(row) {
let data = {
id: row.id,
flowId: row.flowId,
opType: 0,
status: row.currentState
}
this.formVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
addHandle() {
if (!this.flowList.length) {
this.$message({ type: 'error', message: '流程不存在' });
} else if (this.flowList.length === 1) {
this.selectFlow(this.flowList[0])
} else {
this.flowListVisible = true
}
},
//
selectFlow(item) {
let data = {
id: '',
formType: 1,
flowId: item.id,
opType: '-1'
}
this.flowListVisible = false
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
}
}
</script>

@ -438,6 +438,7 @@ export default {
methods: {
productBatch(model, row) {
row.productId = row.id
this.dataForm.warehousingInventoryProductList.push(row)
this.dataForm.warehousingInventoryProductList.splice(0, 1)
},

@ -624,7 +624,7 @@ export default {
warehousingoutboundproductoutboundUnitcolumnOptions: [{ "label": "单位名称", "value": "unit_name" }, { "label": "单位类型", "value": "unit_type" },],
warehousingoutboundproductoutboundAreaIdcolumnOptions: [{ "label": "货区名称", "value": "name" }, { "label": "货区编码", "value": "code" },],
// warehousingoutboundproductbatchNumbercolumnOptions: [{ "label": "", "value": "name" }, { "label": "", "value": "batch_number" },], storage_number
warehousingoutboundproductbatchNumbercolumnOptions: [{ "label": "商品名称", "value": "name" }, { "label": "批次号", "value": "storage_number" },],
warehousingoutboundproductbatchNumbercolumnOptions: [{ "label": "商品名称", "value": "name" }, { "label": "批次号", "value": "batch_number" },],
childIndex: -1,
isEdit: false,

Loading…
Cancel
Save