feat():问题修复

master
jiyufei 2 months ago
parent 20ab1e4923
commit acc6e3f7ff

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-08-06 * 2024-08-19
*/ */
public interface YysDayWorkMapper extends BaseMapper<YysDayWorkEntity> { public interface YysDayWorkMapper extends BaseMapper<YysDayWorkEntity> {

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-08-06 * 2024-08-19
*/ */
public interface YysMonthlyProductionMapper extends BaseMapper<YysMonthlyProductionEntity> { public interface YysMonthlyProductionMapper extends BaseMapper<YysMonthlyProductionEntity> {

@ -1,10 +1,11 @@
package jnpf.service; package jnpf.service;
import jnpf.model.yysclasses.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import jnpf.entity.YysClassesEntity;
import jnpf.model.yysclasses.YysClassesForm;
import jnpf.model.yysclasses.YysClassesPagination;
import java.util.List;
/** /**
* yysClasses * yysClasses
@ -16,7 +17,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
public interface YysClassesService extends IService<YysClassesEntity> { public interface YysClassesService extends IService<YysClassesEntity> {
List<YysClassesEntity> getList(YysClassesPagination yysClassesPagination); List<YysClassesEntity> getList(YysClassesPagination yysClassesPagination);
List<YysClassesEntity> getTypeList(YysClassesPagination yysClassesPagination,String dataType); List<YysClassesEntity> getTypeList(YysClassesPagination yysClassesPagination, String dataType);
YysClassesEntity getInfo(String id); YysClassesEntity getInfo(String id);
@ -28,8 +29,15 @@ public interface YysClassesService extends IService<YysClassesEntity> {
//子表方法 //子表方法
//副表数据方法 //副表数据方法
String checkForm(YysClassesForm form,int i); String checkForm(YysClassesForm form, int i);
void saveOrUpdate(YysClassesForm yysClassesForm,String id, boolean isSave) throws Exception; void saveOrUpdate(YysClassesForm yysClassesForm, String id, boolean isSave) throws Exception;
/**
* id
*
* @param id
* @return
*/
YysClassesEntity getInfoById(String id);
} }

@ -2,9 +2,7 @@ package jnpf.service;
import jnpf.model.yysdaywork.*; import jnpf.model.yysdaywork.*;
import jnpf.entity.*; import jnpf.entity.*;
import java.util.*; import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -13,12 +11,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-08-06 * 2024-08-19
*/ */
public interface YysDayWorkService extends IService<YysDayWorkEntity> { public interface YysDayWorkService extends IService<YysDayWorkEntity> {
List<YysDayWorkEntity> getList(YysDayWorkPagination yysDayWorkPagination); List<YysDayWorkEntity> getList(YysDayWorkPagination yysDayWorkPagination);
List<YysDayWorkEntity> getTypeList(YysDayWorkPagination yysDayWorkPagination, String dataType); List<YysDayWorkEntity> getTypeList(YysDayWorkPagination yysDayWorkPagination,String dataType);
YysDayWorkEntity getInfo(String id); YysDayWorkEntity getInfo(String id);
@ -30,9 +28,9 @@ public interface YysDayWorkService extends IService<YysDayWorkEntity> {
//子表方法 //子表方法
//副表数据方法 //副表数据方法
String checkForm(YysDayWorkForm form, int i); String checkForm(YysDayWorkForm form,int i);
void saveOrUpdate(YysDayWorkForm yysDayWorkForm, String id, boolean isSave) throws Exception; void saveOrUpdate(YysDayWorkForm yysDayWorkForm,String id, boolean isSave) throws Exception;
/** /**
* -app * -app

@ -2,7 +2,9 @@ package jnpf.service;
import jnpf.model.yysmaterialinformation.*; import jnpf.model.yysmaterialinformation.*;
import jnpf.entity.*; import jnpf.entity.*;
import java.util.*; import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -16,7 +18,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
public interface YysMaterialInformationService extends IService<YysMaterialInformationEntity> { public interface YysMaterialInformationService extends IService<YysMaterialInformationEntity> {
List<YysMaterialInformationEntity> getList(YysMaterialInformationPagination yysMaterialInformationPagination); List<YysMaterialInformationEntity> getList(YysMaterialInformationPagination yysMaterialInformationPagination);
List<YysMaterialInformationEntity> getTypeList(YysMaterialInformationPagination yysMaterialInformationPagination,String dataType); List<YysMaterialInformationEntity> getTypeList(YysMaterialInformationPagination yysMaterialInformationPagination, String dataType);
YysMaterialInformationEntity getInfo(String id); YysMaterialInformationEntity getInfo(String id);
@ -28,9 +30,17 @@ public interface YysMaterialInformationService extends IService<YysMaterialInfor
//子表方法 //子表方法
//副表数据方法 //副表数据方法
String checkForm(YysMaterialInformationForm form,int i); String checkForm(YysMaterialInformationForm form, int i);
void saveOrUpdate(YysMaterialInformationForm yysMaterialInformationForm,String id, boolean isSave) throws Exception; void saveOrUpdate(YysMaterialInformationForm yysMaterialInformationForm, String id, boolean isSave) throws Exception;
String syncMaterialInfo(); String syncMaterialInfo();
/**
*
*
* @param code
* @return
*/
YysMaterialInformationEntity getInfoByCode(String code);
} }

@ -11,7 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-08-06 * 2024-08-19
*/ */
public interface YysMonthlyProductionService extends IService<YysMonthlyProductionEntity> { public interface YysMonthlyProductionService extends IService<YysMonthlyProductionEntity> {
List<YysMonthlyProductionEntity> getList(YysMonthlyProductionPagination yysMonthlyProductionPagination); List<YysMonthlyProductionEntity> getList(YysMonthlyProductionPagination yysMonthlyProductionPagination);

@ -1,37 +1,34 @@
package jnpf.service.impl; package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.YysClassesMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.yysclasses.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil; 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 com.baomidou.mybatisplus.annotation.TableField;
import java.util.regex.Pattern; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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 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.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo; import jnpf.base.UserInfo;
import jnpf.base.model.ColumnDataModel;
import jnpf.database.model.superQuery.SuperJsonModel;
import jnpf.entity.YysClassesEntity;
import jnpf.mapper.YysClassesMapper;
import jnpf.model.QueryModel;
import jnpf.model.yysclasses.YysClassesConstant;
import jnpf.model.yysclasses.YysClassesForm;
import jnpf.model.yysclasses.YysClassesPagination;
import jnpf.permission.entity.UserEntity; import jnpf.permission.entity.UserEntity;
import jnpf.service.YysClassesService;
import jnpf.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/** /**
*
* yysClasses * yysClasses
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
@ -39,7 +36,7 @@ import jnpf.permission.entity.UserEntity;
* 2024-08-05 * 2024-08-05
*/ */
@Service @Service
public class YysClassesServiceImpl extends ServiceImpl<YysClassesMapper, YysClassesEntity> implements YysClassesService{ public class YysClassesServiceImpl extends ServiceImpl<YysClassesMapper, YysClassesEntity> implements YysClassesService {
@Autowired @Autowired
private GeneraterSwapUtil generaterSwapUtil; private GeneraterSwapUtil generaterSwapUtil;
@ -47,260 +44,277 @@ public class YysClassesServiceImpl extends ServiceImpl<YysClassesMapper, YysClas
private UserProvider userProvider; private UserProvider userProvider;
@Override @Override
public List<YysClassesEntity> getList(YysClassesPagination yysClassesPagination){ public List<YysClassesEntity> getList(YysClassesPagination yysClassesPagination) {
return getTypeList(yysClassesPagination,yysClassesPagination.getDataType()); return getTypeList(yysClassesPagination, yysClassesPagination.getDataType());
} }
/** 列表查询 */
/**
*
*/
@Override @Override
public List<YysClassesEntity> getTypeList(YysClassesPagination yysClassesPagination,String dataType){ public List<YysClassesEntity> getTypeList(YysClassesPagination yysClassesPagination, String dataType) {
String userId=userProvider.get().getUserId(); String userId = userProvider.get().getUserId();
List<String> AllIdList =new ArrayList(); List<String> AllIdList = new ArrayList();
List<List<String>> intersectionList =new ArrayList<>(); List<List<String>> intersectionList = new ArrayList<>();
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String columnData = !isPc ? YysClassesConstant.getAppColumnData() : YysClassesConstant.getColumnData(); String columnData = !isPc ? YysClassesConstant.getAppColumnData() : YysClassesConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList()); String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0; int total = 0;
int yysClassesNum =0; int yysClassesNum = 0;
QueryWrapper<YysClassesEntity> yysClassesQueryWrapper=new QueryWrapper<>(); QueryWrapper<YysClassesEntity> yysClassesQueryWrapper = new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>(); List<String> allSuperIDlist = new ArrayList<>();
String superOp =""; String superOp = "";
if (ObjectUtil.isNotEmpty(yysClassesPagination.getSuperQueryJson())){ if (ObjectUtil.isNotEmpty(yysClassesPagination.getSuperQueryJson())) {
List<String> allSuperList = new ArrayList<>(); List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>(); List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = yysClassesPagination.getSuperQueryJson(); String queryJson = yysClassesPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class); SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0; int superNum = 0;
QueryWrapper<YysClassesEntity> yysClassesSuperWrapper = new QueryWrapper<>(); QueryWrapper<YysClassesEntity> yysClassesSuperWrapper = new QueryWrapper<>();
yysClassesSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysClassesSuperWrapper,YysClassesEntity.class,queryJson,"0")); yysClassesSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysClassesSuperWrapper, YysClassesEntity.class, queryJson, "0"));
int yysClassesNum1 = yysClassesSuperWrapper.getExpression().getNormal().size(); int yysClassesNum1 = yysClassesSuperWrapper.getExpression().getNormal().size();
if (yysClassesNum1>0){ if (yysClassesNum1 > 0) {
List<String> yysClassesList =this.list(yysClassesSuperWrapper).stream().map(YysClassesEntity::getId).collect(Collectors.toList()); List<String> yysClassesList = this.list(yysClassesSuperWrapper).stream().map(YysClassesEntity::getId).collect(Collectors.toList());
allSuperList.addAll(yysClassesList); allSuperList.addAll(yysClassesList);
intersectionSuperList.add(yysClassesList); intersectionSuperList.add(yysClassesList);
superNum++; superNum++;
} }
superOp = superNum > 0 ? superJsonModel.getMatchLogic() : ""; superOp = superNum > 0 ? superJsonModel.getMatchLogic() : "";
//and or //and or
if(superOp.equalsIgnoreCase("and")){ if (superOp.equalsIgnoreCase("and")) {
allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList); allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList);
}else{ } else {
allSuperIDlist = allSuperList; allSuperIDlist = allSuperList;
} }
} }
List<String> allRuleIDlist = new ArrayList<>(); List<String> allRuleIDlist = new ArrayList<>();
String ruleOp =""; String ruleOp = "";
if (ObjectUtil.isNotEmpty(ruleJson)){ if (ObjectUtil.isNotEmpty(ruleJson)) {
List<String> allRuleList = new ArrayList<>(); List<String> allRuleList = new ArrayList<>();
List<List<String>> intersectionRuleList = new ArrayList<>(); List<List<String>> intersectionRuleList = new ArrayList<>();
SuperJsonModel ruleJsonModel = JsonUtil.getJsonToBean(ruleJson, SuperJsonModel.class); SuperJsonModel ruleJsonModel = JsonUtil.getJsonToBean(ruleJson, SuperJsonModel.class);
int ruleNum = 0; int ruleNum = 0;
QueryWrapper<YysClassesEntity> yysClassesSuperWrapper = new QueryWrapper<>(); QueryWrapper<YysClassesEntity> yysClassesSuperWrapper = new QueryWrapper<>();
yysClassesSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysClassesSuperWrapper,YysClassesEntity.class,ruleJson,"0")); yysClassesSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysClassesSuperWrapper, YysClassesEntity.class, ruleJson, "0"));
int yysClassesNum1 = yysClassesSuperWrapper.getExpression().getNormal().size(); int yysClassesNum1 = yysClassesSuperWrapper.getExpression().getNormal().size();
if (yysClassesNum1>0){ if (yysClassesNum1 > 0) {
List<String> yysClassesList =this.list(yysClassesSuperWrapper).stream().map(YysClassesEntity::getId).collect(Collectors.toList()); List<String> yysClassesList = this.list(yysClassesSuperWrapper).stream().map(YysClassesEntity::getId).collect(Collectors.toList());
allRuleList.addAll(yysClassesList); allRuleList.addAll(yysClassesList);
intersectionRuleList.add(yysClassesList); intersectionRuleList.add(yysClassesList);
ruleNum++; ruleNum++;
} }
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : ""; ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or //and or
if(ruleOp.equalsIgnoreCase("and")){ if (ruleOp.equalsIgnoreCase("and")) {
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList); allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
}else{ } else {
allRuleIDlist = allRuleList; allRuleIDlist = allRuleList;
} }
} }
boolean pcPermission = false; boolean pcPermission = false;
boolean appPermission = false; boolean appPermission = false;
if(isPc && pcPermission){ if (isPc && pcPermission) {
if (!userProvider.get().getIsAdministrator()){ if (!userProvider.get().getIsAdministrator()) {
Object yysClassesObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysClassesQueryWrapper,YysClassesEntity.class,yysClassesPagination.getMenuId(),"0")); Object yysClassesObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysClassesQueryWrapper, YysClassesEntity.class, yysClassesPagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(yysClassesObj)){ if (ObjectUtil.isEmpty(yysClassesObj)) {
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
yysClassesQueryWrapper = (QueryWrapper<YysClassesEntity>)yysClassesObj; yysClassesQueryWrapper = (QueryWrapper<YysClassesEntity>) yysClassesObj;
if( yysClassesQueryWrapper.getExpression().getNormal().size()>0){ if (yysClassesQueryWrapper.getExpression().getNormal().size() > 0) {
yysClassesNum++; yysClassesNum++;
} }
} }
} }
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object yysClassesObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysClassesQueryWrapper,YysClassesEntity.class,yysClassesPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysClassesObj)){
return new ArrayList<>();
} else {
yysClassesQueryWrapper = (QueryWrapper<YysClassesEntity>)yysClassesObj;
if( yysClassesQueryWrapper.getExpression().getNormal().size()>0){
yysClassesNum++;
}
} }
if (!isPc && appPermission) {
if (!userProvider.get().getIsAdministrator()) {
Object yysClassesObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysClassesQueryWrapper, YysClassesEntity.class, yysClassesPagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(yysClassesObj)) {
return new ArrayList<>();
} else {
yysClassesQueryWrapper = (QueryWrapper<YysClassesEntity>) yysClassesObj;
if (yysClassesQueryWrapper.getExpression().getNormal().size() > 0) {
yysClassesNum++;
}
}
} }
} }
if(isPc){ if (isPc) {
if(ObjectUtil.isNotEmpty(yysClassesPagination.getClassesName())){ if (ObjectUtil.isNotEmpty(yysClassesPagination.getClassesName())) {
yysClassesNum++; yysClassesNum++;
String value = yysClassesPagination.getClassesName() instanceof List ? String value = yysClassesPagination.getClassesName() instanceof List ?
JsonUtil.getObjectToString(yysClassesPagination.getClassesName()) : JsonUtil.getObjectToString(yysClassesPagination.getClassesName()) :
String.valueOf(yysClassesPagination.getClassesName()); String.valueOf(yysClassesPagination.getClassesName());
yysClassesQueryWrapper.lambda().like(YysClassesEntity::getClassesName,value); yysClassesQueryWrapper.lambda().like(YysClassesEntity::getClassesName, value);
} }
if(ObjectUtil.isNotEmpty(yysClassesPagination.getEnabledStatus())){ if (ObjectUtil.isNotEmpty(yysClassesPagination.getEnabledStatus())) {
yysClassesNum++; yysClassesNum++;
List<String> idList = new ArrayList<>(); List<String> idList = new ArrayList<>();
try { try {
String[][] enabledStatus = JsonUtil.getJsonToBean(yysClassesPagination.getEnabledStatus(),String[][].class); String[][] enabledStatus = JsonUtil.getJsonToBean(yysClassesPagination.getEnabledStatus(), String[][].class);
for(int i=0;i<enabledStatus.length;i++){ for (int i = 0; i < enabledStatus.length; i++) {
if(enabledStatus[i].length>0){ if (enabledStatus[i].length > 0) {
idList.add(JsonUtil.getObjectToString(Arrays.asList(enabledStatus[i]))); idList.add(JsonUtil.getObjectToString(Arrays.asList(enabledStatus[i])));
} }
} }
}catch (Exception e1){ } catch (Exception e1) {
try { try {
List<String> enabledStatus = JsonUtil.getJsonToList(yysClassesPagination.getEnabledStatus(),String.class); List<String> enabledStatus = JsonUtil.getJsonToList(yysClassesPagination.getEnabledStatus(), String.class);
if(enabledStatus.size()>0){ if (enabledStatus.size() > 0) {
idList.addAll(enabledStatus); idList.addAll(enabledStatus);
} }
}catch (Exception e2){ } catch (Exception e2) {
idList.add(String.valueOf(yysClassesPagination.getEnabledStatus())); idList.add(String.valueOf(yysClassesPagination.getEnabledStatus()));
} }
} }
yysClassesQueryWrapper.lambda().and(t->{ yysClassesQueryWrapper.lambda().and(t -> {
idList.forEach(tt->{ idList.forEach(tt -> {
t.like(YysClassesEntity::getEnabledStatus, tt).or(); t.like(YysClassesEntity::getEnabledStatus, tt).or();
}); });
}); });
} }
} }
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList); List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){ if (total > 0) {
if (intersection.size()==0){ if (intersection.size() == 0) {
intersection.add("jnpfNullList"); intersection.add("jnpfNullList");
} }
yysClassesQueryWrapper.lambda().in(YysClassesEntity::getId, intersection); yysClassesQueryWrapper.lambda().in(YysClassesEntity::getId, intersection);
} }
//是否有高级查询 //是否有高级查询
if (StringUtil.isNotEmpty(superOp)){ if (StringUtil.isNotEmpty(superOp)) {
if (allSuperIDlist.size()==0){ if (allSuperIDlist.size() == 0) {
allSuperIDlist.add("jnpfNullList"); allSuperIDlist.add("jnpfNullList");
} }
List<String> finalAllSuperIDlist = allSuperIDlist; List<String> finalAllSuperIDlist = allSuperIDlist;
yysClassesQueryWrapper.lambda().and(t->t.in(YysClassesEntity::getId, finalAllSuperIDlist)); yysClassesQueryWrapper.lambda().and(t -> t.in(YysClassesEntity::getId, finalAllSuperIDlist));
} }
//是否有数据过滤查询 //是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){ if (StringUtil.isNotEmpty(ruleOp)) {
if (allRuleIDlist.size()==0){ if (allRuleIDlist.size() == 0) {
allRuleIDlist.add("jnpfNullList"); allRuleIDlist.add("jnpfNullList");
} }
List<String> finalAllRuleIDlist = allRuleIDlist; List<String> finalAllRuleIDlist = allRuleIDlist;
yysClassesQueryWrapper.lambda().and(t->t.in(YysClassesEntity::getId, finalAllRuleIDlist)); yysClassesQueryWrapper.lambda().and(t -> t.in(YysClassesEntity::getId, finalAllRuleIDlist));
} }
//排序 //排序
if(StringUtil.isEmpty(yysClassesPagination.getSidx())){ if (StringUtil.isEmpty(yysClassesPagination.getSidx())) {
yysClassesQueryWrapper.lambda().orderByDesc(YysClassesEntity::getId); yysClassesQueryWrapper.lambda().orderByDesc(YysClassesEntity::getId);
}else{ } else {
try { try {
String sidx = yysClassesPagination.getSidx(); String sidx = yysClassesPagination.getSidx();
String[] strs= sidx.split("_name"); String[] strs = sidx.split("_name");
YysClassesEntity yysClassesEntity = new YysClassesEntity(); YysClassesEntity yysClassesEntity = new YysClassesEntity();
Field declaredField = yysClassesEntity.getClass().getDeclaredField(strs[0]); Field declaredField = yysClassesEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true); declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value(); String value = declaredField.getAnnotation(TableField.class).value();
yysClassesQueryWrapper="asc".equals(yysClassesPagination.getSort().toLowerCase())?yysClassesQueryWrapper.orderByAsc(value):yysClassesQueryWrapper.orderByDesc(value); yysClassesQueryWrapper = "asc".equals(yysClassesPagination.getSort().toLowerCase()) ? yysClassesQueryWrapper.orderByAsc(value) : yysClassesQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) { } catch (NoSuchFieldException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
yysClassesQueryWrapper.lambda().isNull(YysClassesEntity::getDeleteMark); yysClassesQueryWrapper.lambda().isNull(YysClassesEntity::getDeleteMark);
if("0".equals(dataType)){ if ("0".equals(dataType)) {
if((total>0 && AllIdList.size()>0) || total==0){ if ((total > 0 && AllIdList.size() > 0) || total == 0) {
Page<YysClassesEntity> page=new Page<>(yysClassesPagination.getCurrentPage(), yysClassesPagination.getPageSize()); Page<YysClassesEntity> page = new Page<>(yysClassesPagination.getCurrentPage(), yysClassesPagination.getPageSize());
IPage<YysClassesEntity> userIPage=this.page(page, yysClassesQueryWrapper); IPage<YysClassesEntity> userIPage = this.page(page, yysClassesQueryWrapper);
return yysClassesPagination.setData(userIPage.getRecords(),userIPage.getTotal()); return yysClassesPagination.setData(userIPage.getRecords(), userIPage.getTotal());
}else{ } else {
List<YysClassesEntity> list = new ArrayList(); List<YysClassesEntity> list = new ArrayList();
return yysClassesPagination.setData(list, list.size()); return yysClassesPagination.setData(list, list.size());
} }
}else{ } else {
return this.list(yysClassesQueryWrapper); return this.list(yysClassesQueryWrapper);
} }
} }
@Override @Override
public YysClassesEntity getInfo(String id){ public YysClassesEntity getInfo(String id) {
QueryWrapper<YysClassesEntity> queryWrapper=new QueryWrapper<>(); QueryWrapper<YysClassesEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(YysClassesEntity::getId,id); queryWrapper.lambda().eq(YysClassesEntity::getId, id);
return this.getOne(queryWrapper); return this.getOne(queryWrapper);
} }
@Override @Override
public void create(YysClassesEntity entity){ public void create(YysClassesEntity entity) {
this.save(entity); this.save(entity);
} }
@Override @Override
public boolean update(String id, YysClassesEntity entity){ public boolean update(String id, YysClassesEntity entity) {
return this.updateById(entity); return this.updateById(entity);
} }
@Override @Override
public void delete(YysClassesEntity entity){ public void delete(YysClassesEntity entity) {
if(entity!=null){ if (entity != null) {
entity.setDeleteMark(1); entity.setDeleteMark(1);
entity.setDeleteTime(DateUtil.getNowDate()); entity.setDeleteTime(DateUtil.getNowDate());
this.updateById(entity); this.updateById(entity);
} }
} }
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
/**
* i-0-1
*/
@Override @Override
public String checkForm(YysClassesForm form,int i) { public String checkForm(YysClassesForm form, int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0"); boolean isUp = StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id=""; String id = "";
String countRecover = ""; String countRecover = "";
if (isUp){ if (isUp) {
id = form.getId(); id = form.getId();
} }
//主表字段验证 //主表字段验证
if(StringUtil.isEmpty(form.getClassesName())){ if (StringUtil.isEmpty(form.getClassesName())) {
return "班次名称不能为空"; return "班次名称不能为空";
} }
return countRecover; return countRecover;
} }
/** /**
* () * ()
* @param id *
* @param yysClassesForm * @param id
* @return * @param yysClassesForm
*/ * @return
*/
@Override @Override
@Transactional @Transactional
public void saveOrUpdate(YysClassesForm yysClassesForm,String id, boolean isSave) throws Exception{ public void saveOrUpdate(YysClassesForm yysClassesForm, String id, boolean isSave) throws Exception {
UserInfo userInfo=userProvider.get(); UserInfo userInfo = userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId()); UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
yysClassesForm = JsonUtil.getJsonToBean( yysClassesForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(YysClassesConstant.getFormData(),yysClassesForm),YysClassesForm.class); generaterSwapUtil.swapDatetime(YysClassesConstant.getFormData(), yysClassesForm), YysClassesForm.class);
YysClassesEntity entity = JsonUtil.getJsonToBean(yysClassesForm, YysClassesEntity.class); YysClassesEntity entity = JsonUtil.getJsonToBean(yysClassesForm, YysClassesEntity.class);
if(isSave){ if (isSave) {
String mainId = RandomUtil.uuId() ; String mainId = RandomUtil.uuId();
entity.setCreatorTime(DateUtil.getNowDate()); entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId()); entity.setCreatorUserId(userInfo.getUserId());
entity.setId(mainId); entity.setId(mainId);
}else{ } else {
entity.setLastModifyTime(DateUtil.getNowDate()); entity.setLastModifyTime(DateUtil.getNowDate());
entity.setLastModifyUserId(userInfo.getUserId()); entity.setLastModifyUserId(userInfo.getUserId());
} }
this.saveOrUpdate(entity); this.saveOrUpdate(entity);
} }
@Override
public YysClassesEntity getInfoById(String id) {
return this.getById(id);
}
} }

@ -23,22 +23,19 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
*
* yysDayWork * yysDayWork
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-08-06 * 2024-08-19
*/ */
@Service @Service
public class YysDayWorkServiceImpl extends ServiceImpl<YysDayWorkMapper, YysDayWorkEntity> implements YysDayWorkService { public class YysDayWorkServiceImpl extends ServiceImpl<YysDayWorkMapper, YysDayWorkEntity> implements YysDayWorkService{
@Autowired @Autowired
private GeneraterSwapUtil generaterSwapUtil; private GeneraterSwapUtil generaterSwapUtil;
@ -64,139 +61,112 @@ public class YysDayWorkServiceImpl extends ServiceImpl<YysDayWorkMapper, YysDayW
private YysRequisitionReportService yysRequisitionReportService; private YysRequisitionReportService yysRequisitionReportService;
@Override @Override
public List<YysDayWorkEntity> getList(YysDayWorkPagination yysDayWorkPagination) { public List<YysDayWorkEntity> getList(YysDayWorkPagination yysDayWorkPagination){
return getTypeList(yysDayWorkPagination, yysDayWorkPagination.getDataType()); return getTypeList(yysDayWorkPagination,yysDayWorkPagination.getDataType());
} }
/** 列表查询 */
/**
*
*/
@Override @Override
public List<YysDayWorkEntity> getTypeList(YysDayWorkPagination yysDayWorkPagination, String dataType) { public List<YysDayWorkEntity> getTypeList(YysDayWorkPagination yysDayWorkPagination,String dataType){
String userId = userProvider.get().getUserId(); String userId=userProvider.get().getUserId();
List<String> AllIdList = new ArrayList(); List<String> AllIdList =new ArrayList();
List<List<String>> intersectionList = new ArrayList<>(); List<List<String>> intersectionList =new ArrayList<>();
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String columnData = !isPc ? YysDayWorkConstant.getAppColumnData() : YysDayWorkConstant.getColumnData(); String columnData = !isPc ? YysDayWorkConstant.getAppColumnData() : YysDayWorkConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class); ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList()); String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total = 0; int total=0;
int yysDayWorkNum = 0; int yysDayWorkNum =0;
QueryWrapper<YysDayWorkEntity> yysDayWorkQueryWrapper = new QueryWrapper<>(); QueryWrapper<YysDayWorkEntity> yysDayWorkQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>(); List<String> allSuperIDlist = new ArrayList<>();
String superOp = ""; String superOp ="";
if (ObjectUtil.isNotEmpty(yysDayWorkPagination.getSuperQueryJson())) { if (ObjectUtil.isNotEmpty(yysDayWorkPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>(); List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>(); List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = yysDayWorkPagination.getSuperQueryJson(); String queryJson = yysDayWorkPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class); SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0; int superNum = 0;
QueryWrapper<YysDayWorkEntity> yysDayWorkSuperWrapper = new QueryWrapper<>(); QueryWrapper<YysDayWorkEntity> yysDayWorkSuperWrapper = new QueryWrapper<>();
yysDayWorkSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysDayWorkSuperWrapper, YysDayWorkEntity.class, queryJson, "0")); yysDayWorkSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysDayWorkSuperWrapper,YysDayWorkEntity.class,queryJson,"0"));
int yysDayWorkNum1 = yysDayWorkSuperWrapper.getExpression().getNormal().size(); int yysDayWorkNum1 = yysDayWorkSuperWrapper.getExpression().getNormal().size();
if (yysDayWorkNum1 > 0) { if (yysDayWorkNum1>0){
List<String> yysDayWorkList = this.list(yysDayWorkSuperWrapper).stream().map(YysDayWorkEntity::getId).collect(Collectors.toList()); List<String> yysDayWorkList =this.list(yysDayWorkSuperWrapper).stream().map(YysDayWorkEntity::getId).collect(Collectors.toList());
allSuperList.addAll(yysDayWorkList); allSuperList.addAll(yysDayWorkList);
intersectionSuperList.add(yysDayWorkList); intersectionSuperList.add(yysDayWorkList);
superNum++; superNum++;
} }
superOp = superNum > 0 ? superJsonModel.getMatchLogic() : ""; superOp = superNum > 0 ? superJsonModel.getMatchLogic() : "";
//and or //and or
if (superOp.equalsIgnoreCase("and")) { if(superOp.equalsIgnoreCase("and")){
allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList); allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList);
} else { }else{
allSuperIDlist = allSuperList; allSuperIDlist = allSuperList;
} }
} }
List<String> allRuleIDlist = new ArrayList<>(); List<String> allRuleIDlist = new ArrayList<>();
String ruleOp = ""; String ruleOp ="";
if (ObjectUtil.isNotEmpty(ruleJson)) { if (ObjectUtil.isNotEmpty(ruleJson)){
List<String> allRuleList = new ArrayList<>(); List<String> allRuleList = new ArrayList<>();
List<List<String>> intersectionRuleList = new ArrayList<>(); List<List<String>> intersectionRuleList = new ArrayList<>();
SuperJsonModel ruleJsonModel = JsonUtil.getJsonToBean(ruleJson, SuperJsonModel.class); SuperJsonModel ruleJsonModel = JsonUtil.getJsonToBean(ruleJson, SuperJsonModel.class);
int ruleNum = 0; int ruleNum = 0;
QueryWrapper<YysDayWorkEntity> yysDayWorkSuperWrapper = new QueryWrapper<>(); QueryWrapper<YysDayWorkEntity> yysDayWorkSuperWrapper = new QueryWrapper<>();
yysDayWorkSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysDayWorkSuperWrapper, YysDayWorkEntity.class, ruleJson, "0")); yysDayWorkSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysDayWorkSuperWrapper,YysDayWorkEntity.class,ruleJson,"0"));
int yysDayWorkNum1 = yysDayWorkSuperWrapper.getExpression().getNormal().size(); int yysDayWorkNum1 = yysDayWorkSuperWrapper.getExpression().getNormal().size();
if (yysDayWorkNum1 > 0) { if (yysDayWorkNum1>0){
List<String> yysDayWorkList = this.list(yysDayWorkSuperWrapper).stream().map(YysDayWorkEntity::getId).collect(Collectors.toList()); List<String> yysDayWorkList =this.list(yysDayWorkSuperWrapper).stream().map(YysDayWorkEntity::getId).collect(Collectors.toList());
allRuleList.addAll(yysDayWorkList); allRuleList.addAll(yysDayWorkList);
intersectionRuleList.add(yysDayWorkList); intersectionRuleList.add(yysDayWorkList);
ruleNum++; ruleNum++;
} }
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : ""; ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or //and or
if (ruleOp.equalsIgnoreCase("and")) { if(ruleOp.equalsIgnoreCase("and")){
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList); allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
} else { }else{
allRuleIDlist = allRuleList; allRuleIDlist = allRuleList;
} }
} }
boolean pcPermission = false; boolean pcPermission = false;
boolean appPermission = false; boolean appPermission = false;
if (isPc && pcPermission) { if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()) { if (!userProvider.get().getIsAdministrator()){
Object yysDayWorkObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysDayWorkQueryWrapper, YysDayWorkEntity.class, yysDayWorkPagination.getMenuId(), "0")); Object yysDayWorkObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysDayWorkQueryWrapper,YysDayWorkEntity.class,yysDayWorkPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysDayWorkObj)) { if (ObjectUtil.isEmpty(yysDayWorkObj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
yysDayWorkQueryWrapper = (QueryWrapper<YysDayWorkEntity>) yysDayWorkObj; yysDayWorkQueryWrapper = (QueryWrapper<YysDayWorkEntity>)yysDayWorkObj;
if (yysDayWorkQueryWrapper.getExpression().getNormal().size() > 0) { if( yysDayWorkQueryWrapper.getExpression().getNormal().size()>0){
yysDayWorkNum++; yysDayWorkNum++;
} }
} }
} }
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object yysDayWorkObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysDayWorkQueryWrapper,YysDayWorkEntity.class,yysDayWorkPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysDayWorkObj)){
return new ArrayList<>();
} else {
yysDayWorkQueryWrapper = (QueryWrapper<YysDayWorkEntity>)yysDayWorkObj;
if( yysDayWorkQueryWrapper.getExpression().getNormal().size()>0){
yysDayWorkNum++;
} }
if (!isPc && appPermission) {
if (!userProvider.get().getIsAdministrator()) {
Object yysDayWorkObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysDayWorkQueryWrapper, YysDayWorkEntity.class, yysDayWorkPagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(yysDayWorkObj)) {
return new ArrayList<>();
} else {
yysDayWorkQueryWrapper = (QueryWrapper<YysDayWorkEntity>) yysDayWorkObj;
if (yysDayWorkQueryWrapper.getExpression().getNormal().size() > 0) {
yysDayWorkNum++;
}
}
}
} }
if (isPc) {
if (ObjectUtil.isNotEmpty(yysDayWorkPagination.getYears())) {
yysDayWorkNum++;
String years = yysDayWorkPagination.getYears().toString();
String startDateStr = years + "01";
LocalDate startDate = LocalDate.parse(startDateStr, DateTimeFormatter.ofPattern("yyyyMMdd"));
LocalDate endDate = startDate.withDayOfMonth(startDate.lengthOfMonth());
Date start = Date.from(startDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
Date end = Date.from(endDate.atTime(LocalTime.MAX).atZone(ZoneId.systemDefault()).toInstant());
// 使用日期范围构建查询条件
yysDayWorkQueryWrapper.lambda()
.ge(YysDayWorkEntity::getManufactureTime, start)
.le(YysDayWorkEntity::getManufactureTime, end);
}
if (ObjectUtil.isNotEmpty(yysDayWorkPagination.getDeliveryTime())) {
yysDayWorkNum++;
List DeliveryTimeList = JsonUtil.getJsonToList(yysDayWorkPagination.getDeliveryTime(), String.class);
Long fir = Long.valueOf(String.valueOf(DeliveryTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(DeliveryTimeList.get(1)));
yysDayWorkQueryWrapper.lambda().ge(YysDayWorkEntity::getDeliveryTime, new Date(fir)) }
.le(YysDayWorkEntity::getDeliveryTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59")); }
} if(isPc){
if (ObjectUtil.isNotEmpty(yysDayWorkPagination.getManufactureTime())) { if(ObjectUtil.isNotEmpty(yysDayWorkPagination.getManufactureTime())){
yysDayWorkNum++; yysDayWorkNum++;
List ManufactureTimeList = JsonUtil.getJsonToList(yysDayWorkPagination.getManufactureTime(), String.class); List ManufactureTimeList = JsonUtil.getJsonToList(yysDayWorkPagination.getManufactureTime(),String.class);
Long fir = Long.valueOf(String.valueOf(ManufactureTimeList.get(0))); Long fir = Long.valueOf(String.valueOf(ManufactureTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(ManufactureTimeList.get(1))); Long sec = Long.valueOf(String.valueOf(ManufactureTimeList.get(1)));
yysDayWorkQueryWrapper.lambda().ge(YysDayWorkEntity::getManufactureTime, new Date(fir)) yysDayWorkQueryWrapper.lambda().ge(YysDayWorkEntity::getManufactureTime, new Date(fir))
.le(YysDayWorkEntity::getManufactureTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59")); .le(YysDayWorkEntity::getManufactureTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
} }
@ -215,74 +185,74 @@ public class YysDayWorkServiceImpl extends ServiceImpl<YysDayWorkMapper, YysDayW
yysDayWorkNum++; yysDayWorkNum++;
String value = yysDayWorkPagination.getProductName() instanceof List ? String value = yysDayWorkPagination.getProductName() instanceof List ?
JsonUtil.getObjectToString(yysDayWorkPagination.getProductName()) : JsonUtil.getObjectToString(yysDayWorkPagination.getProductName()) :
String.valueOf(yysDayWorkPagination.getProductName()); String.valueOf(yysDayWorkPagination.getProductName());
yysDayWorkQueryWrapper.lambda().like(YysDayWorkEntity::getProductName, value); yysDayWorkQueryWrapper.lambda().like(YysDayWorkEntity::getProductName,value);
} }
if (ObjectUtil.isNotEmpty(yysDayWorkPagination.getDeviceName())) { if(ObjectUtil.isNotEmpty(yysDayWorkPagination.getDeviceName())){
yysDayWorkNum++; yysDayWorkNum++;
String value = yysDayWorkPagination.getDeviceName() instanceof List ? String value = yysDayWorkPagination.getDeviceName() instanceof List ?
JsonUtil.getObjectToString(yysDayWorkPagination.getDeviceName()) : JsonUtil.getObjectToString(yysDayWorkPagination.getDeviceName()) :
String.valueOf(yysDayWorkPagination.getDeviceName()); String.valueOf(yysDayWorkPagination.getDeviceName());
yysDayWorkQueryWrapper.lambda().like(YysDayWorkEntity::getDeviceName, value); yysDayWorkQueryWrapper.lambda().like(YysDayWorkEntity::getDeviceName,value);
} }
if (ObjectUtil.isNotEmpty(yysDayWorkPagination.getProductionStatus())) { if(ObjectUtil.isNotEmpty(yysDayWorkPagination.getProductionStatus())){
yysDayWorkNum++; yysDayWorkNum++;
List<String> idList = new ArrayList<>(); List<String> idList = new ArrayList<>();
try { try {
String[][] productionStatus = JsonUtil.getJsonToBean(yysDayWorkPagination.getProductionStatus(), String[][].class); String[][] productionStatus = JsonUtil.getJsonToBean(yysDayWorkPagination.getProductionStatus(),String[][].class);
for (int i = 0; i < productionStatus.length; i++) { for(int i=0;i<productionStatus.length;i++){
if (productionStatus[i].length > 0) { if(productionStatus[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(productionStatus[i]))); idList.add(JsonUtil.getObjectToString(Arrays.asList(productionStatus[i])));
} }
} }
} catch (Exception e1) { }catch (Exception e1){
try { try {
List<String> productionStatus = JsonUtil.getJsonToList(yysDayWorkPagination.getProductionStatus(), String.class); List<String> productionStatus = JsonUtil.getJsonToList(yysDayWorkPagination.getProductionStatus(),String.class);
if (productionStatus.size() > 0) { if(productionStatus.size()>0){
idList.addAll(productionStatus); idList.addAll(productionStatus);
} }
} catch (Exception e2) { }catch (Exception e2){
idList.add(String.valueOf(yysDayWorkPagination.getProductionStatus())); idList.add(String.valueOf(yysDayWorkPagination.getProductionStatus()));
} }
} }
yysDayWorkQueryWrapper.lambda().and(t -> { yysDayWorkQueryWrapper.lambda().and(t->{
idList.forEach(tt -> { idList.forEach(tt->{
t.like(YysDayWorkEntity::getProductionStatus, tt).or(); t.like(YysDayWorkEntity::getProductionStatus, tt).or();
}); });
}); });
} }
} }
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList); List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total > 0) { if (total>0){
if (intersection.size() == 0) { if (intersection.size()==0){
intersection.add("jnpfNullList"); intersection.add("jnpfNullList");
} }
yysDayWorkQueryWrapper.lambda().in(YysDayWorkEntity::getId, intersection); yysDayWorkQueryWrapper.lambda().in(YysDayWorkEntity::getId, intersection);
} }
//是否有高级查询 //是否有高级查询
if (StringUtil.isNotEmpty(superOp)) { if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size() == 0) { if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList"); allSuperIDlist.add("jnpfNullList");
} }
List<String> finalAllSuperIDlist = allSuperIDlist; List<String> finalAllSuperIDlist = allSuperIDlist;
yysDayWorkQueryWrapper.lambda().and(t -> t.in(YysDayWorkEntity::getId, finalAllSuperIDlist)); yysDayWorkQueryWrapper.lambda().and(t->t.in(YysDayWorkEntity::getId, finalAllSuperIDlist));
} }
//是否有数据过滤查询 //是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)) { if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size() == 0) { if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList"); allRuleIDlist.add("jnpfNullList");
} }
List<String> finalAllRuleIDlist = allRuleIDlist; List<String> finalAllRuleIDlist = allRuleIDlist;
yysDayWorkQueryWrapper.lambda().and(t -> t.in(YysDayWorkEntity::getId, finalAllRuleIDlist)); yysDayWorkQueryWrapper.lambda().and(t->t.in(YysDayWorkEntity::getId, finalAllRuleIDlist));
} }
//假删除标志 //假删除标志
yysDayWorkQueryWrapper.lambda().isNull(YysDayWorkEntity::getDeleteMark); yysDayWorkQueryWrapper.lambda().isNull(YysDayWorkEntity::getDeleteMark);
@ -305,88 +275,79 @@ public class YysDayWorkServiceImpl extends ServiceImpl<YysDayWorkMapper, YysDayW
// } // }
// } // }
if ("0".equals(dataType)) { if("0".equals(dataType)){
if ((total > 0 && AllIdList.size() > 0) || total == 0) { if((total>0 && AllIdList.size()>0) || total==0){
Page<YysDayWorkEntity> page = new Page<>(yysDayWorkPagination.getCurrentPage(), yysDayWorkPagination.getPageSize()); Page<YysDayWorkEntity> page=new Page<>(yysDayWorkPagination.getCurrentPage(), yysDayWorkPagination.getPageSize());
IPage<YysDayWorkEntity> userIPage = this.page(page, yysDayWorkQueryWrapper); IPage<YysDayWorkEntity> userIPage=this.page(page, yysDayWorkQueryWrapper);
return yysDayWorkPagination.setData(userIPage.getRecords(), userIPage.getTotal()); return yysDayWorkPagination.setData(userIPage.getRecords(),userIPage.getTotal());
} else { }else{
List<YysDayWorkEntity> list = new ArrayList(); List<YysDayWorkEntity> list = new ArrayList();
return yysDayWorkPagination.setData(list, list.size()); return yysDayWorkPagination.setData(list, list.size());
} }
} else { }else{
return this.list(yysDayWorkQueryWrapper); return this.list(yysDayWorkQueryWrapper);
} }
} }
@Override @Override
public YysDayWorkEntity getInfo(String id) { public YysDayWorkEntity getInfo(String id){
QueryWrapper<YysDayWorkEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<YysDayWorkEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(YysDayWorkEntity::getId, id); queryWrapper.lambda().eq(YysDayWorkEntity::getId,id);
return this.getOne(queryWrapper); return this.getOne(queryWrapper);
} }
@Override @Override
public void create(YysDayWorkEntity entity) { public void create(YysDayWorkEntity entity){
this.save(entity); this.save(entity);
} }
@Override @Override
public boolean update(String id, YysDayWorkEntity entity) { public boolean update(String id, YysDayWorkEntity entity){
return this.updateById(entity); return this.updateById(entity);
} }
@Override @Override
public void delete(YysDayWorkEntity entity) { public void delete(YysDayWorkEntity entity){
if (entity != null) { if(entity!=null){
this.removeById(entity.getId()); this.removeById(entity.getId());
} }
} }
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
/**
* i-0-1
*/
@Override @Override
public String checkForm(YysDayWorkForm form, int i) { public String checkForm(YysDayWorkForm form,int i) {
boolean isUp = StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0"); boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id = ""; String id="";
String countRecover = ""; String countRecover = "";
if (isUp) { if (isUp){
id = form.getId(); id = form.getId();
} }
//主表字段验证 //主表字段验证
if (StringUtil.isEmpty(form.getProductCode())) { if(StringUtil.isEmpty(form.getProductName())){
return "产品编码不能为空"; return "产品名称不能为空";
} }
if (StringUtil.isNotEmpty(form.getProductName())) { if(StringUtil.isNotEmpty(form.getProductName())){
form.setProductName(form.getProductName().trim()); form.setProductName(form.getProductName().trim());
QueryWrapper<YysDayWorkEntity> productNameWrapper = new QueryWrapper<>(); QueryWrapper<YysDayWorkEntity> productNameWrapper=new QueryWrapper<>();
productNameWrapper.lambda().eq(YysDayWorkEntity::getProductName, form.getProductName()); productNameWrapper.lambda().eq(YysDayWorkEntity::getProductName,form.getProductName());
//假删除标志 //假删除标志
productNameWrapper.lambda().isNull(YysDayWorkEntity::getDeleteMark); productNameWrapper.lambda().isNull(YysDayWorkEntity::getDeleteMark);
if (isUp) { if (isUp){
productNameWrapper.lambda().ne(YysDayWorkEntity::getId, id); productNameWrapper.lambda().ne(YysDayWorkEntity::getId, id);
} }
if ((int) this.count(productNameWrapper) > 0) { if((int) this.count(productNameWrapper)>0){
countRecover = "产品名称不能重复"; countRecover = "产品名称不能重复";
} }
} }
if (StringUtil.isEmpty(form.getModels())) { if(StringUtil.isEmpty(form.getModels())){
return "规格型号不能为空"; return "规格型号不能为空";
} }
if (StringUtil.isEmpty(form.getMeasurementUnit())) { if(StringUtil.isEmpty(form.getMeasurementUnit())){
return "计量单位不能为空"; return "计量单位不能为空";
} }
return countRecover; return countRecover;
} }
/** /**
* () * ()
* * @param id
* @param id * @param yysDayWorkForm
* @param yysDayWorkForm * @return
* @return */
*/
@Override @Override
@Transactional @Transactional
public void saveOrUpdate(YysDayWorkForm yysDayWorkForm, String id, boolean isSave) throws Exception { public void saveOrUpdate(YysDayWorkForm yysDayWorkForm, String id, boolean isSave) throws Exception {

@ -367,4 +367,11 @@ public class YysMaterialInformationServiceImpl extends ServiceImpl<YysMaterialIn
} }
return "同步失败"; return "同步失败";
} }
@Override
public YysMaterialInformationEntity getInfoByCode(String code) {
LambdaQueryWrapper<YysMaterialInformationEntity> wrapper = new LambdaQueryWrapper<>(YysMaterialInformationEntity.class)
.eq(YysMaterialInformationEntity::getMaterialId, code).isNull(YysMaterialInformationEntity::getDeleteMark);
return this.getOne(wrapper);
}
} }

@ -1,57 +1,42 @@
package jnpf.service.impl; package jnpf.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import jnpf.entity.*;
import jnpf.mapper.YysMonthlyProductionMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.yysmonthlyproduction.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil; 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 com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import java.util.regex.Pattern; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.base.UserInfo;
import jnpf.base.model.ColumnDataModel;
import jnpf.database.model.superQuery.SuperJsonModel; import jnpf.database.model.superQuery.SuperJsonModel;
import jnpf.entity.YysMonthlyProductionEntity;
import jnpf.mapper.YysMonthlyProductionMapper;
import jnpf.model.QueryModel;
import jnpf.model.yysmonthlyproduction.YysMonthlyProductionConstant;
import jnpf.model.yysmonthlyproduction.YysMonthlyProductionForm;
import jnpf.model.yysmonthlyproduction.YysMonthlyProductionPagination;
import jnpf.permission.entity.UserEntity;
import jnpf.service.YysMonthlyProductionService;
import jnpf.util.*;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; 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 java.lang.reflect.Field;
import jnpf.permission.entity.UserEntity; import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/** /**
* yysMonthlyProduction * yysMonthlyProduction
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
* JNPF * JNPF
* 2024-08-06 * 2024-08-19
*/ */
@Service @Service
public class YysMonthlyProductionServiceImpl extends ServiceImpl<YysMonthlyProductionMapper, YysMonthlyProductionEntity> implements YysMonthlyProductionService { public class YysMonthlyProductionServiceImpl extends ServiceImpl<YysMonthlyProductionMapper, YysMonthlyProductionEntity> implements YysMonthlyProductionService {

@ -1,53 +1,39 @@
package jnpf.controller; package jnpf.controller;
import cn.hutool.core.util.ObjectUtil; import cn.afterturn.easypoi.excel.ExcelExportUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.xuyanwu.spring.file.storage.FileInfo;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult; import jnpf.base.ActionResult;
import jnpf.base.UserInfo; import jnpf.base.UserInfo;
import jnpf.exception.DataException; import jnpf.base.model.ColumnDataModel;
import jnpf.permission.entity.UserEntity; import jnpf.base.util.VisualUtils;
import jnpf.service.*; import jnpf.base.vo.DownloadVO;
import jnpf.entity.*;
import jnpf.util.*;
import jnpf.model.yysclasses.*;
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.PageListVO;
import jnpf.base.vo.PaginationVO; import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity; import jnpf.entity.YysClassesEntity;
import java.io.IOException; import jnpf.model.visualJson.config.HeaderModel;
import java.util.stream.Collectors; import jnpf.model.yysclasses.YysClassesConstant;
import jnpf.engine.entity.FlowTaskEntity; import jnpf.model.yysclasses.YysClassesForm;
import jnpf.exception.WorkFlowException; import jnpf.model.yysclasses.YysClassesPagination;
import org.springframework.web.multipart.MultipartFile; import jnpf.service.YysClassesService;
import cn.afterturn.easypoi.excel.ExcelExportUtil; import jnpf.util.*;
import cn.afterturn.easypoi.excel.ExcelImportUtil; import lombok.Cleanup;
import cn.afterturn.easypoi.excel.entity.ExportParams; import lombok.extern.slf4j.Slf4j;
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.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import java.io.File; import org.springframework.beans.factory.annotation.Autowired;
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; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import java.io.IOException;
import java.util.*;
/** /**
* yysClasses * yysClasses
@ -327,4 +313,10 @@ public class YysClassesController {
return ActionResult.success(yysClassesMap); return ActionResult.success(yysClassesMap);
} }
@Operation(summary = "根据id获取信息")
@GetMapping("/getInfoById/{id}")
public ActionResult getInfoById(@PathVariable String id) {
return ActionResult.success(yysClassesService.getInfoById(id));
}
} }

@ -1,49 +1,60 @@
package jnpf.controller; package jnpf.controller;
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.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.xuyanwu.spring.file.storage.FileInfo; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult; import jnpf.base.ActionResult;
import jnpf.base.UserInfo; import jnpf.base.UserInfo;
import jnpf.base.model.ColumnDataModel; import jnpf.exception.DataException;
import jnpf.base.util.VisualUtils; import jnpf.permission.entity.UserEntity;
import jnpf.base.vo.DownloadVO; import jnpf.service.*;
import jnpf.entity.*;
import jnpf.util.*;
import jnpf.model.yysdaywork.*;
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.PageListVO;
import jnpf.base.vo.PaginationVO; import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.entity.YysDayWorkEntity; import jnpf.base.entity.ProvinceEntity;
import jnpf.entity.YysGroupEntity;
import jnpf.model.visualJson.config.HeaderModel; import java.io.IOException;
import jnpf.model.yysdaywork.*; 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.ExcelImFieldModel;
import jnpf.onlinedev.model.OnlineImport.ExcelImportModel;
import jnpf.onlinedev.model.OnlineImport.ImportDataModel; import jnpf.onlinedev.model.OnlineImport.ImportDataModel;
import jnpf.onlinedev.model.OnlineImport.ImportFormCheckUniqueModel; import jnpf.onlinedev.model.OnlineImport.ImportFormCheckUniqueModel;
import jnpf.onlinedev.model.OnlineImport.ExcelImportModel;
import jnpf.onlinedev.model.OnlineImport.VisualImportModel; import jnpf.onlinedev.model.OnlineImport.VisualImportModel;
import jnpf.service.YysDayPackageService; import cn.xuyanwu.spring.file.storage.FileInfo;
import jnpf.service.YysDayWorkService;
import jnpf.service.YysGroupService;
import jnpf.util.*;
import lombok.Cleanup; import lombok.Cleanup;
import lombok.extern.slf4j.Slf4j; import jnpf.model.visualJson.config.HeaderModel;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import jnpf.base.model.ColumnDataModel;
import org.apache.poi.ss.usermodel.Workbook; import jnpf.base.util.VisualUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import java.io.File;
import java.io.IOException;
import java.util.*;
/** /**
* yysDayWork * yysDayWork
@ -51,7 +62,7 @@ import java.util.*;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-08-06 * @ 2024-08-19
*/ */
@Slf4j @Slf4j
@RestController @RestController
@ -68,6 +79,10 @@ public class YysDayWorkController {
@Autowired @Autowired
private YysDayWorkService yysDayWorkService; private YysDayWorkService yysDayWorkService;
@Autowired
private YysClassesService yysClassesService;
@Autowired @Autowired
private ConfigValueUtil configValueUtil; private ConfigValueUtil configValueUtil;
@ -167,9 +182,6 @@ public class YysDayWorkController {
case "deviceName": case "deviceName":
entitys.add(new ExcelExportEntity("设备名称", "deviceName")); entitys.add(new ExcelExportEntity("设备名称", "deviceName"));
break; break;
case "sort":
entitys.add(new ExcelExportEntity("顺序号", "sort"));
break;
case "post": case "post":
entitys.add(new ExcelExportEntity("班次", "post")); entitys.add(new ExcelExportEntity("班次", "post"));
break; break;
@ -194,6 +206,9 @@ public class YysDayWorkController {
case "planNumber": case "planNumber":
entitys.add(new ExcelExportEntity("计量数量", "planNumber")); entitys.add(new ExcelExportEntity("计量数量", "planNumber"));
break; break;
case "sort":
entitys.add(new ExcelExportEntity("顺序号", "sort"));
break;
case "productionStatus": case "productionStatus":
entitys.add(new ExcelExportEntity("生产状态", "productionStatus")); entitys.add(new ExcelExportEntity("生产状态", "productionStatus"));
break; break;

@ -201,4 +201,10 @@ public class YysMaterialInformationController {
} }
return ActionResult.fail(result); return ActionResult.fail(result);
} }
@Operation(summary = "根据编码获取信息")
@GetMapping("/getInfoByCode/{code}")
public ActionResult getInfoByCode(@PathVariable String code) {
return ActionResult.success(yysMaterialInformationService.getInfoByCode(code));
}
} }

@ -61,7 +61,7 @@ import org.springframework.transaction.annotation.Transactional;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-08-06 * @ 2024-08-19
*/ */
@Slf4j @Slf4j
@RestController @RestController

@ -16,6 +16,8 @@ import java.util.Date;
public class YysDayPackageEntity { public class YysDayPackageEntity {
@TableId(value ="ID" ) @TableId(value ="ID" )
private String id; private String id;
@TableField("MONTH_ID")
private String monthId;
@TableField(value = "MANUFACTURE_TIME" , updateStrategy = FieldStrategy.IGNORED) @TableField(value = "MANUFACTURE_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date manufactureTime; private Date manufactureTime;
@TableField(value = "DEVICE_CODE" , updateStrategy = FieldStrategy.IGNORED) @TableField(value = "DEVICE_CODE" , updateStrategy = FieldStrategy.IGNORED)

@ -9,14 +9,14 @@ import java.util.Date;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-08-06 * @ 2024-08-19
*/ */
@Data @Data
@TableName("yys_day_work") @TableName("yys_day_work")
public class YysDayWorkEntity { public class YysDayWorkEntity {
@TableId(value ="ID" ) @TableId(value ="ID" )
private String id; private String id;
@TableField(value ="MONTH_ID" ) @TableField("MONTH_ID")
private String monthId; private String monthId;
@TableField(value = "MANUFACTURE_TIME" , updateStrategy = FieldStrategy.IGNORED) @TableField(value = "MANUFACTURE_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date manufactureTime; private Date manufactureTime;
@ -44,10 +44,10 @@ public class YysDayWorkEntity {
private String planNumber; private String planNumber;
@TableField(value = "PRODUCTION_STATUS" , updateStrategy = FieldStrategy.IGNORED) @TableField(value = "PRODUCTION_STATUS" , updateStrategy = FieldStrategy.IGNORED)
private String productionStatus; private String productionStatus;
@TableField("IS_CONFIRM")
private String isConfirm;
@TableField("DELIVERY_TIME") @TableField("DELIVERY_TIME")
private Date deliveryTime; private Date deliveryTime;
@TableField(value = "IS_CONFIRM" , updateStrategy = FieldStrategy.IGNORED)
private String isConfirm;
@TableField("F_CREATOR_TIME") @TableField("F_CREATOR_TIME")
private Date creatorTime; private Date creatorTime;
@TableField("F_CREATOR_USER_ID") @TableField("F_CREATOR_USER_ID")

@ -2,35 +2,35 @@ package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
/** /**
*
*
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-08-06 * @ 2024-08-19
*/ */
@Data @Data
@TableName("yys_monthly_production") @TableName("yys_monthly_production")
public class YysMonthlyProductionEntity { public class YysMonthlyProductionEntity {
@TableId(value = "ID") @TableId(value ="ID" )
private String id; private String id;
@TableField(value = "YEARS", updateStrategy = FieldStrategy.IGNORED) @TableField(value = "YEARS" , updateStrategy = FieldStrategy.IGNORED)
private Date years; private Date years;
@TableField(value = "PRODUCT_ID", updateStrategy = FieldStrategy.IGNORED) @TableField(value = "PRODUCT_ID" , updateStrategy = FieldStrategy.IGNORED)
private String productId; private String productId;
@TableField(value = "PRODUCT_NAME", updateStrategy = FieldStrategy.IGNORED) @TableField(value = "PRODUCT_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String productName; private String productName;
@TableField(value = "MODEL", updateStrategy = FieldStrategy.IGNORED) @TableField(value = "MODEL" , updateStrategy = FieldStrategy.IGNORED)
private String model; private String model;
@TableField(value = "MEASUREMENT_UNIT", updateStrategy = FieldStrategy.IGNORED) @TableField(value = "MEASUREMENT_UNIT" , updateStrategy = FieldStrategy.IGNORED)
private String measurementUnit; private String measurementUnit;
@TableField(value = "MEASUREMENT_NUMBER", updateStrategy = FieldStrategy.IGNORED) @TableField(value = "MEASUREMENT_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private String measurementNumber; private String measurementNumber;
@TableField(value = "CURRENT_INVENTORY", updateStrategy = FieldStrategy.IGNORED) @TableField(value = "CURRENT_INVENTORY" , updateStrategy = FieldStrategy.IGNORED)
private String currentInventory; private String currentInventory;
@TableField(value = "DELIVERY_TIME", updateStrategy = FieldStrategy.IGNORED) @TableField(value = "DELIVERY_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date deliveryTime; private Date deliveryTime;
@TableField("F_CREATOR_TIME") @TableField("F_CREATOR_TIME")
private Date creatorTime; private Date creatorTime;

@ -11,7 +11,7 @@ import com.alibaba.fastjson.annotation.JSONField;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-08-06 * @ 2024-08-19
*/ */
@Data @Data
public class YysDayWorkExcelErrorVO extends YysDayWorkExcelVO{ public class YysDayWorkExcelErrorVO extends YysDayWorkExcelVO{

@ -17,7 +17,7 @@ import java.util.List;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-08-06 * @ 2024-08-19
*/ */
@Data @Data
public class YysDayWorkExcelVO{ public class YysDayWorkExcelVO{

@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-08-06 * @ 2024-08-19
*/ */
@Data @Data
public class YysDayWorkForm { public class YysDayWorkForm {
@ -29,12 +29,9 @@ public class YysDayWorkForm {
/** 设备名称 **/ /** 设备名称 **/
@JsonProperty("deviceName") @JsonProperty("deviceName")
private String deviceName; private String deviceName;
/** 顺序号 **/
@JsonProperty("sort")
private BigDecimal sort;
/** 班次 **/ /** 班次 **/
@JsonProperty("post") @JsonProperty("post")
private Object post; private String post;
/** 开始时间 **/ /** 开始时间 **/
@JsonProperty("startTime") @JsonProperty("startTime")
private String startTime; private String startTime;
@ -56,6 +53,9 @@ public class YysDayWorkForm {
/** 计量数量 **/ /** 计量数量 **/
@JsonProperty("planNumber") @JsonProperty("planNumber")
private BigDecimal planNumber; private BigDecimal planNumber;
/** 顺序号 **/
@JsonProperty("sort")
private BigDecimal sort;
/** 生产状态 **/ /** 生产状态 **/
@JsonProperty("productionStatus") @JsonProperty("productionStatus")
private Object productionStatus; private Object productionStatus;

@ -11,7 +11,7 @@ import java.util.List;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-08-06 * @ 2024-08-19
*/ */
@Data @Data
public class YysDayWorkPagination extends Pagination { public class YysDayWorkPagination extends Pagination {

@ -11,7 +11,7 @@ import com.alibaba.fastjson.annotation.JSONField;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-08-06 * @ 2024-08-19
*/ */
@Data @Data
public class YysMonthlyProductionExcelErrorVO extends YysMonthlyProductionExcelVO{ public class YysMonthlyProductionExcelErrorVO extends YysMonthlyProductionExcelVO{

@ -17,7 +17,7 @@ import java.util.List;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-08-06 * @ 2024-08-19
*/ */
@Data @Data
public class YysMonthlyProductionExcelVO{ public class YysMonthlyProductionExcelVO{

@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-08-06 * @ 2024-08-19
*/ */
@Data @Data
public class YysMonthlyProductionForm { public class YysMonthlyProductionForm {
@ -19,6 +19,7 @@ public class YysMonthlyProductionForm {
/** 乐观锁 **/ /** 乐观锁 **/
@JsonProperty("version") @JsonProperty("version")
private Integer version; private Integer version;
/** 年月 **/ /** 年月 **/
@JsonProperty("years") @JsonProperty("years")
private String years; private String years;

@ -11,7 +11,7 @@ import java.util.List;
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
* @ 2024-08-06 * @ 2024-08-19
*/ */
@Data @Data
public class YysMonthlyProductionPagination extends Pagination { public class YysMonthlyProductionPagination extends Pagination {

@ -30,19 +30,10 @@
<p>{{dataForm.deviceName}}</p> <p>{{dataForm.deviceName}}</p>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="顺序号"
prop="sort" >
<JnpfNumber v-model="dataForm.sort"
placeholder="顺序号" disabled
:min="1" :step="1" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" > <el-col :span="8" >
<jnpf-form-tip-item label="班次" <jnpf-form-tip-item label="班次"
prop="post" > prop="post" >
<p>{{ dataForm.post }} </p> <p>{{dataForm.post}}</p>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8" >
@ -90,6 +81,15 @@
</JnpfNumber> </JnpfNumber>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="顺序号"
prop="sort" >
<JnpfNumber v-model="dataForm.sort"
placeholder="顺序号" disabled
:min="1" :step="1" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" > <el-col :span="8" >
<jnpf-form-tip-item label="生产状态" <jnpf-form-tip-item label="生产状态"
prop="productionStatus" > prop="productionStatus" >
@ -123,19 +123,17 @@
manufactureTime : '', manufactureTime : '',
deviceCode : "", deviceCode : "",
deviceName : '', deviceName : '',
sort : 1, post : "",
post : "1",
startTime : '', startTime : '',
endTime : '', endTime : '',
productCode : '', productCode : "",
productName : '', productName : '',
models : '', models : '',
measurementUnit : '', measurementUnit : '',
planNumber : '', planNumber : '',
sort : 1,
productionStatus : "", productionStatus : "",
}, },
postOptions:[{"fullName":"旺季白班","id":"1"},{"fullName":"旺季晚班","id":"2"}],
postProps:{"label":"fullName","value":"id" },
productionStatusOptions:[{"fullName":"未开工","id":"1"},{"fullName":"已完工","id":"2"}], productionStatusOptions:[{"fullName":"未开工","id":"1"},{"fullName":"已完工","id":"2"}],
productionStatusProps:{"label":"fullName","value":"id" }, productionStatusProps:{"label":"fullName","value":"id" },

File diff suppressed because one or more lines are too long

@ -28,7 +28,6 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<jnpf-form-tip-item label="设备编码" prop="deviceCode"> <jnpf-form-tip-item label="设备编码" prop="deviceCode">
<JnpfPopupSelect v-model="dataForm.deviceCode" @change="changeData('deviceCode', -1)" <JnpfPopupSelect v-model="dataForm.deviceCode" @change="changeData('deviceCode', -1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.deviceCode" :rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.deviceCode"
placeholder="请选择设备编码" propsValue="device_code" popupWidth="800px" popupTitle="选择数据" placeholder="请选择设备编码" propsValue="device_code" popupWidth="800px" popupTitle="选择数据"
@ -36,28 +35,24 @@
interfaceId="590497496266971845" :pageSize="20" interfaceId="590497496266971845" :pageSize="20"
:columnOptions="deviceCodecolumnOptions" clearable :style='{ "width": "100%" }'> :columnOptions="deviceCodecolumnOptions" clearable :style='{ "width": "100%" }'>
</JnpfPopupSelect> </JnpfPopupSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<jnpf-form-tip-item label="设备名称" prop="deviceName"> <jnpf-form-tip-item label="设备名称" prop="deviceName">
<JnpfInput v-model="dataForm.deviceName" @change="changeData('deviceName', -1)" <JnpfInput v-model="dataForm.deviceName" @change="changeData('deviceName', -1)"
placeholder="选择设备编码后自动带入" disabled clearable :style='{ "width": "100%" }'> placeholder="请输入设备名称" clearable :style='{ "width": "100%" }'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8">
<jnpf-form-tip-item label="顺序号" prop="sort">
<JnpfInputNumber v-model="dataForm.sort" @change="changeData('sort', -1)"
placeholder="顺序号" :min="1" :step="1">
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<jnpf-form-tip-item label="班次" prop="post"> <jnpf-form-tip-item label="班次" prop="post">
<JnpfSelect v-model="dataForm.post" @change="changeData('post', -1)" placeholder="请选择班次" <JnpfPopupSelect v-model="dataForm.post" @change="changeData('post', -1)"
clearable :style='{ "width": "100%" }' :options="postOptions" :props="postProps"> :rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.post"
</JnpfSelect> placeholder="请选择" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='classes_name' field='post'
interfaceId="595237502952944325" :pageSize="20" :columnOptions="postcolumnOptions"
clearable :style='{ "width": "100%" }'>
</JnpfPopupSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
@ -82,9 +77,13 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<jnpf-form-tip-item label="产品编码" prop="productCode"> <jnpf-form-tip-item label="产品编码" prop="productCode">
<JnpfInput v-model="dataForm.productCode" @change="changeData('productCode', -1)" <JnpfPopupSelect v-model="dataForm.productCode" @change="changeData('productCode', -1)"
placeholder="请输入产品编码" clearable :style='{ "width": "100%" }'> :rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.productCode"
</JnpfInput> placeholder="请选择产品编码" hasPage propsValue="material_id" popupWidth="800px"
popupTitle="选择数据" popupType="dialog" relationField='material_name'
field='productCode' interfaceId="593079067666820933" :pageSize="20"
:columnOptions="productCodecolumnOptions" clearable :style='{ "width": "100%" }'>
</JnpfPopupSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -116,11 +115,18 @@
</JnpfInputNumber> </JnpfInputNumber>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8">
<jnpf-form-tip-item label="顺序号" prop="sort">
<JnpfInputNumber v-model="dataForm.sort" @change="changeData('sort', -1)"
placeholder="顺序号" :min="1" :step="1">
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<jnpf-form-tip-item label="生产状态" prop="productionStatus"> <jnpf-form-tip-item label="生产状态" prop="productionStatus">
<JnpfSelect v-model="dataForm.productionStatus" <JnpfSelect v-model="dataForm.productionStatus"
@change="changeData('productionStatus', -1)" placeholder="请选择生产状态" clearable disabled @change="changeData('productionStatus', -1)" placeholder="请选择生产状态" clearable
:style='{ "width": "100%" }' :options="productionStatusOptions" disabled :style='{ "width": "100%" }' :options="productionStatusOptions"
:props="productionStatusProps"> :props="productionStatusProps">
</JnpfSelect> </JnpfSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
@ -179,8 +185,7 @@ export default {
manufactureTime: undefined, manufactureTime: undefined,
deviceCode: undefined, deviceCode: undefined,
deviceName: undefined, deviceName: undefined,
sort: 1, post: undefined,
post: "1",
startTime: undefined, startTime: undefined,
endTime: undefined, endTime: undefined,
productCode: undefined, productCode: undefined,
@ -188,6 +193,7 @@ export default {
models: undefined, models: undefined,
measurementUnit: undefined, measurementUnit: undefined,
planNumber: undefined, planNumber: undefined,
sort: 1,
productionStatus: '1', productionStatus: '1',
version: 0, version: 0,
}, },
@ -211,7 +217,7 @@ export default {
post: [ post: [
{ {
required: true, required: true,
message: '请至少选择一个', message: '请选择',
trigger: 'change' trigger: 'change'
}, },
], ],
@ -232,8 +238,8 @@ export default {
productCode: [ productCode: [
{ {
required: true, required: true,
message: '请输入产品编码', message: '请选择产品编码',
trigger: 'blur' trigger: 'change'
}, },
], ],
productName: [ productName: [
@ -243,6 +249,13 @@ export default {
trigger: 'blur' trigger: 'blur'
}, },
], ],
deviceName: [
{
required: true,
message: '请输入产品名称',
trigger: 'blur'
},
],
models: [ models: [
{ {
required: true, required: true,
@ -266,8 +279,8 @@ export default {
], ],
}, },
deviceCodecolumnOptions: [{ "label": "设备编码", "value": "device_code" }, { "label": "设备名称", "value": "device_name" }, { "label": "设备类型", "value": "device_desc" },], deviceCodecolumnOptions: [{ "label": "设备编码", "value": "device_code" }, { "label": "设备名称", "value": "device_name" }, { "label": "设备类型", "value": "device_desc" },],
postOptions: [{ "fullName": "旺季白班", "id": "1" }, { "fullName": "旺季晚班", "id": "2" }, { "fullName": "淡季白班", "id": "3" }, { "fullName": "淡季晚班", "id": "4" }], postcolumnOptions: [{ "label": "班次", "value": "classes_name" }, { "label": "开始时间", "value": "start_time" }, { "label": "结束时间", "value": "end_time" }, { "label": "时长", "value": "classes_duration" },],
postProps: { "label": "fullName", "value": "id" }, productCodecolumnOptions: [{ "label": "产品编码", "value": "material_id" }, { "label": "产品名称", "value": "material_name" }, { "label": "规格型号", "value": "model" }, { "label": "计量单位", "value": "unit_measurement" }, { "label": "安全库存", "value": "safety_stock" },],
productionStatusOptions: [{ "fullName": "未开工", "id": "1" }, { "fullName": "已完工", "id": "2" }], productionStatusOptions: [{ "fullName": "未开工", "id": "1" }, { "fullName": "已完工", "id": "2" }],
productionStatusProps: { "label": "fullName", "value": "id" }, productionStatusProps: { "label": "fullName", "value": "id" },
childIndex: -1, childIndex: -1,
@ -276,7 +289,6 @@ export default {
manufactureTime: [], manufactureTime: [],
deviceCode: [], deviceCode: [],
deviceName: [], deviceName: [],
sort: [],
post: [], post: [],
startTime: [], startTime: [],
endTime: [], endTime: [],
@ -285,6 +297,7 @@ export default {
models: [], models: [],
measurementUnit: [], measurementUnit: [],
planNumber: [], planNumber: [],
sort: [],
productionStatus: [], productionStatus: [],
}, },
} }
@ -339,14 +352,40 @@ export default {
this.$emit('refreshDataList', true) this.$emit('refreshDataList', true)
}, },
changeData(model, index) { changeData(model, index) {
if (model == 'post' && this.dataForm.post != undefined) {
request({
url: '/api/example/YysClasses/getInfoById/' + this.dataForm.post,
method: 'get'
}).then(res => {
let _data = res.data;
let _dataForm = { ...this.dataForm }
_dataForm.startTime = _data.startTime
_dataForm.endTime = _data.endTime
this.dataForm = { ..._dataForm };
});
}
if (model == 'deviceCode' && this.dataForm.deviceCode != undefined) { if (model == 'deviceCode' && this.dataForm.deviceCode != undefined) {
request({ request({
url: '/api/example/YysDevice/queryNameByCode/' + this.dataForm.deviceCode, url: '/api/example/YysDevice/queryNameByCode/' + this.dataForm.deviceCode,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
let _dataForm = {...this.dataForm} let _dataForm = { ...this.dataForm }
_dataForm.deviceName = res.msg _dataForm.deviceName = res.msg
this.dataForm = {..._dataForm}; this.dataForm = { ..._dataForm };
});
}
if (model == 'productCode' && this.dataForm.productCode != undefined) {
request({
url: '/api/example/YysMaterialInformation/getInfoByCode/' + this.dataForm.productCode,
method: 'get'
}).then(res => {
let _data = res.data;
let _dataForm = { ...this.dataForm }
_dataForm.productName = _data.materialName
_dataForm.models = _data.model
_dataForm.measurementUnit = _data.unitMeasurement
_dataForm.currentInventory = _data.safetyStock
this.dataForm = { ..._dataForm };
}); });
} }
this.isEdit = false this.isEdit = false

@ -11,21 +11,16 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="产品编码"> <el-form-item label="产品名称">
<el-input v-model="query.productCode" placeholder="请输入" clearable> </el-input> <el-input v-model="query.productName" placeholder="请输入" clearable> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="产品名称"> <el-form-item label="设备名称">
<el-input v-model="query.productName" placeholder="请输入" clearable> </el-input> <el-input v-model="query.deviceName" placeholder="请输入" clearable> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<template v-if="showAll"> <template v-if="showAll">
<el-col :span="6">
<el-form-item label="设备名称">
<el-input v-model="query.deviceName" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="生产状态"> <el-form-item label="生产状态">
<JnpfSelect v-model="query.productionStatus" placeholder="请选择生产状态" clearable <JnpfSelect v-model="query.productionStatus" placeholder="请选择生产状态" clearable
@ -82,10 +77,7 @@
<JnpfNumber v-model="scope.row.sort" :thousands="false" /> <JnpfNumber v-model="scope.row.sort" :thousands="false" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="班次" prop="post" align="center"> <el-table-column prop="post" label="班次" align="center">
<template slot-scope="scope">
{{ scope.row.post }}
</template>
</el-table-column> </el-table-column>
<el-table-column prop="startTime" label="开始时间" align="center"> <el-table-column prop="startTime" label="开始时间" align="center">
</el-table-column> </el-table-column>
@ -186,7 +178,6 @@ export default {
detailVisible: false, detailVisible: false,
query: { query: {
manufactureTime: undefined, manufactureTime: undefined,
productCode: undefined,
productName: undefined, productName: undefined,
deviceName: undefined, deviceName: undefined,
productionStatus: undefined, productionStatus: undefined,
@ -213,12 +204,12 @@ export default {
flowListVisible: false, flowListVisible: false,
flowList: [], flowList: [],
exportBoxVisible: false, exportBoxVisible: false,
postOptions: [{ "fullName": "旺季白班", "id": "1" }, { "fullName": "旺季晚班", "id": "2" }],
postProps: { "label": "fullName", "value": "id" },
productionStatusOptions: [{ "fullName": "未开工", "id": "1" }, { "fullName": "已完工", "id": "2" }], productionStatusOptions: [{ "fullName": "未开工", "id": "1" }, { "fullName": "已完工", "id": "2" }],
productionStatusProps: { "label": "fullName", "value": "id" }, productionStatusProps: { "label": "fullName", "value": "id" },
interfaceRes: { interfaceRes: {
deviceCode: [], deviceCode: [],
post: [],
productCode: [],
}, },
} }
}, },
@ -402,10 +393,10 @@ export default {
const year = now.getFullYear(); const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0'); const month = String(now.getMonth() + 1).padStart(2, '0');
const startDate = `${year}-${month}-01 00:00:00`; const startDate = `${year}-${month}-01 00:00:00`;
const startDateTimestamp = new Date(startDate).getTime(); const startDateTimestamp = new Date(startDate).getTime();
const endDate = `${year}-${month}-${new Date(year, now.getMonth() + 1, 0).getDate()}`; const endDate = `${year}-${month}-${new Date(year, now.getMonth() + 1, 0).getDate()}`;
const endDateTimestamp = new Date(endDate).getTime(); const endDateTimestamp = new Date(endDate).getTime();
this.query.manufactureTime = [startDateTimestamp, endDateTimestamp]; this.query.manufactureTime = [startDateTimestamp, endDateTimestamp];
}, },
initData() { initData() {
this.listLoading = true; this.listLoading = true;

File diff suppressed because one or more lines are too long

@ -82,7 +82,7 @@
dataForm: { dataForm: {
id :'', id :'',
years : '', years : '',
productId : '', productId : "",
productName : '', productName : '',
model : '', model : '',
measurementUnit : '', measurementUnit : '',

File diff suppressed because one or more lines are too long

@ -17,9 +17,13 @@
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<jnpf-form-tip-item label="产品编码" prop="productId"> <jnpf-form-tip-item label="产品编码" prop="productId">
<JnpfInput v-model="dataForm.productId" @change="changeData('productId', -1)" <JnpfPopupSelect v-model="dataForm.productId" @change="changeData('productId', -1)"
placeholder="请输入产品编码" clearable :style='{ "width": "100%" }'> :rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.productId"
</JnpfInput> placeholder="请选择产品编码" propsValue="material_id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='material_name' field='productId'
interfaceId="593079067666820933" :pageSize="20" :columnOptions="productIdcolumnOptions"
clearable :style='{ "width": "100%" }'>
</JnpfPopupSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
@ -143,8 +147,8 @@ export default {
productId: [ productId: [
{ {
required: true, required: true,
message: '请输入产品编码', message: '请选择产品编码',
trigger: 'blur' trigger: 'change'
}, },
], ],
productName: [ productName: [
@ -195,6 +199,7 @@ export default {
}, },
], ],
}, },
productIdcolumnOptions: [{ "label": "产品编码", "value": "material_id" }, { "label": "产品名称", "value": "material_name" }, { "label": "规格型号", "value": "model" }, { "label": "计量单位", "value": "unit_measurement" }, { "label": "安全库存", "value": "safety_stock" },],
childIndex: -1, childIndex: -1,
isEdit: false, isEdit: false,
interfaceRes: { interfaceRes: {
@ -259,6 +264,20 @@ export default {
this.$emit('refreshDataList', true) this.$emit('refreshDataList', true)
}, },
changeData(model, index) { changeData(model, index) {
if (model == 'productId' && this.dataForm.productId != undefined ) {
request({
url: '/api/example/YysMaterialInformation/getInfoByCode/' + this.dataForm.productId,
method: 'get'
}).then(res => {
let _data = res.data;
let _dataForm = {...this.dataForm}
_dataForm.productName = _data.materialName
_dataForm.model = _data.model
_dataForm.measurementUnit = _data.unitMeasurement
_dataForm.currentInventory = _data.safetyStock
this.dataForm = {..._dataForm};
});
}
this.isEdit = false this.isEdit = false
this.childIndex = index this.childIndex = index
let modelAll = model.split("-"); let modelAll = model.split("-");

@ -163,6 +163,7 @@ export default {
flowList: [], flowList: [],
exportBoxVisible: false, exportBoxVisible: false,
interfaceRes: { interfaceRes: {
productId: [],
}, },
} }
}, },
@ -346,8 +347,8 @@ export default {
const year = now.getFullYear(); const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0'); const month = String(now.getMonth() + 1).padStart(2, '0');
const startDate = `${year}-${month}-01 00:00:00`; const startDate = `${year}-${month}-01 00:00:00`;
const startDateTimestamp = new Date(startDate).getTime(); const startDateTimestamp = new Date(startDate).getTime();
this.query.years = [startDateTimestamp, startDateTimestamp]; this.query.years = [startDateTimestamp, startDateTimestamp];
}, },
initData() { initData() {
this.listLoading = true; this.listLoading = true;

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save