feat():问题修复

master
jiyufei 2 months ago
parent acc6e3f7ff
commit b85c4ec20d

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

@ -15,12 +15,12 @@ import jnpf.model.yysdaywork.ConfirmResponse;
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-06
* 2024-08-19
*/
public interface YysDayPackageService extends IService<YysDayPackageEntity> {
List<YysDayPackageEntity> getList(YysDayPackagePagination yysDayPackagePagination);
List<YysDayPackageEntity> getTypeList(YysDayPackagePagination yysDayPackagePagination, String dataType);
List<YysDayPackageEntity> getTypeList(YysDayPackagePagination yysDayPackagePagination,String dataType);
YysDayPackageEntity getInfo(String id);
@ -32,9 +32,9 @@ public interface YysDayPackageService extends IService<YysDayPackageEntity> {
//子表方法
//副表数据方法
String checkForm(YysDayPackageForm form, int i);
String checkForm(YysDayPackageForm form,int i);
void saveOrUpdate(YysDayPackageForm yysDayPackageForm, String id, boolean isSave) throws Exception;
void saveOrUpdate(YysDayPackageForm yysDayPackageForm,String id, boolean isSave) throws Exception;
/**
* -app

@ -39,25 +39,21 @@ 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;
/**
*
* yysDayPackage
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-06
* 2024-08-19
*/
@Service
public class YysDayPackageServiceImpl extends ServiceImpl<YysDayPackageMapper, YysDayPackageEntity> implements YysDayPackageService {
public class YysDayPackageServiceImpl extends ServiceImpl<YysDayPackageMapper, YysDayPackageEntity> implements YysDayPackageService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@ -71,172 +67,169 @@ public class YysDayPackageServiceImpl extends ServiceImpl<YysDayPackageMapper, Y
private YysPackageReportService yysPackageReportService;
@Override
public List<YysDayPackageEntity> getList(YysDayPackagePagination yysDayPackagePagination) {
return getTypeList(yysDayPackagePagination, yysDayPackagePagination.getDataType());
public List<YysDayPackageEntity> getList(YysDayPackagePagination yysDayPackagePagination){
return getTypeList(yysDayPackagePagination,yysDayPackagePagination.getDataType());
}
/**
*
*/
/** 列表查询 */
@Override
public List<YysDayPackageEntity> getTypeList(YysDayPackagePagination yysDayPackagePagination, String dataType) {
String userId = userProvider.get().getUserId();
List<String> AllIdList = new ArrayList();
List<List<String>> intersectionList = new ArrayList<>();
public List<YysDayPackageEntity> getTypeList(YysDayPackagePagination yysDayPackagePagination,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 ? YysDayPackageConstant.getAppColumnData() : YysDayPackageConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total = 0;
int yysDayPackageNum = 0;
QueryWrapper<YysDayPackageEntity> yysDayPackageQueryWrapper = new QueryWrapper<>();
int total=0;
int yysDayPackageNum =0;
QueryWrapper<YysDayPackageEntity> yysDayPackageQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp = "";
if (ObjectUtil.isNotEmpty(yysDayPackagePagination.getSuperQueryJson())) {
String superOp ="";
if (ObjectUtil.isNotEmpty(yysDayPackagePagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = yysDayPackagePagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<YysDayPackageEntity> yysDayPackageSuperWrapper = new QueryWrapper<>();
yysDayPackageSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysDayPackageSuperWrapper, YysDayPackageEntity.class, queryJson, "0"));
yysDayPackageSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysDayPackageSuperWrapper,YysDayPackageEntity.class,queryJson,"0"));
int yysDayPackageNum1 = yysDayPackageSuperWrapper.getExpression().getNormal().size();
if (yysDayPackageNum1 > 0) {
List<String> yysDayPackageList = this.list(yysDayPackageSuperWrapper).stream().map(YysDayPackageEntity::getId).collect(Collectors.toList());
if (yysDayPackageNum1>0){
List<String> yysDayPackageList =this.list(yysDayPackageSuperWrapper).stream().map(YysDayPackageEntity::getId).collect(Collectors.toList());
allSuperList.addAll(yysDayPackageList);
intersectionSuperList.add(yysDayPackageList);
superNum++;
}
superOp = superNum > 0 ? superJsonModel.getMatchLogic() : "";
//and or
if (superOp.equalsIgnoreCase("and")) {
if(superOp.equalsIgnoreCase("and")){
allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList);
} else {
}else{
allSuperIDlist = allSuperList;
}
}
List<String> allRuleIDlist = new ArrayList<>();
String ruleOp = "";
if (ObjectUtil.isNotEmpty(ruleJson)) {
String ruleOp ="";
if (ObjectUtil.isNotEmpty(ruleJson)){
List<String> allRuleList = new ArrayList<>();
List<List<String>> intersectionRuleList = new ArrayList<>();
List<List<String>> intersectionRuleList = new ArrayList<>();
SuperJsonModel ruleJsonModel = JsonUtil.getJsonToBean(ruleJson, SuperJsonModel.class);
int ruleNum = 0;
QueryWrapper<YysDayPackageEntity> yysDayPackageSuperWrapper = new QueryWrapper<>();
yysDayPackageSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysDayPackageSuperWrapper, YysDayPackageEntity.class, ruleJson, "0"));
yysDayPackageSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysDayPackageSuperWrapper,YysDayPackageEntity.class,ruleJson,"0"));
int yysDayPackageNum1 = yysDayPackageSuperWrapper.getExpression().getNormal().size();
if (yysDayPackageNum1 > 0) {
List<String> yysDayPackageList = this.list(yysDayPackageSuperWrapper).stream().map(YysDayPackageEntity::getId).collect(Collectors.toList());
if (yysDayPackageNum1>0){
List<String> yysDayPackageList =this.list(yysDayPackageSuperWrapper).stream().map(YysDayPackageEntity::getId).collect(Collectors.toList());
allRuleList.addAll(yysDayPackageList);
intersectionRuleList.add(yysDayPackageList);
ruleNum++;
}
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or
if (ruleOp.equalsIgnoreCase("and")) {
if(ruleOp.equalsIgnoreCase("and")){
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
} else {
}else{
allRuleIDlist = allRuleList;
}
}
boolean pcPermission = false;
boolean appPermission = false;
if (isPc && pcPermission) {
if (!userProvider.get().getIsAdministrator()) {
Object yysDayPackageObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysDayPackageQueryWrapper, YysDayPackageEntity.class, yysDayPackagePagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(yysDayPackageObj)) {
return new ArrayList<>();
} else {
yysDayPackageQueryWrapper = (QueryWrapper<YysDayPackageEntity>) yysDayPackageObj;
if (yysDayPackageQueryWrapper.getExpression().getNormal().size() > 0) {
yysDayPackageNum++;
}
}
}
boolean pcPermission = false;
boolean appPermission = false;
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object yysDayPackageObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysDayPackageQueryWrapper,YysDayPackageEntity.class,yysDayPackagePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysDayPackageObj)){
return new ArrayList<>();
} else {
yysDayPackageQueryWrapper = (QueryWrapper<YysDayPackageEntity>)yysDayPackageObj;
if( yysDayPackageQueryWrapper.getExpression().getNormal().size()>0){
yysDayPackageNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object yysDayPackageObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysDayPackageQueryWrapper,YysDayPackageEntity.class,yysDayPackagePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysDayPackageObj)){
return new ArrayList<>();
} else {
yysDayPackageQueryWrapper = (QueryWrapper<YysDayPackageEntity>)yysDayPackageObj;
if( yysDayPackageQueryWrapper.getExpression().getNormal().size()>0){
yysDayPackageNum++;
}
}
if (!isPc && appPermission) {
if (!userProvider.get().getIsAdministrator()) {
Object yysDayPackageObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysDayPackageQueryWrapper, YysDayPackageEntity.class, yysDayPackagePagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(yysDayPackageObj)) {
return new ArrayList<>();
} else {
yysDayPackageQueryWrapper = (QueryWrapper<YysDayPackageEntity>) yysDayPackageObj;
if (yysDayPackageQueryWrapper.getExpression().getNormal().size() > 0) {
yysDayPackageNum++;
}
}
}
}
if (isPc) {
if (ObjectUtil.isNotEmpty(yysDayPackagePagination.getManufactureTime())) {
yysDayPackageNum++;
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(yysDayPackagePagination.getManufactureTime())){
yysDayPackageNum++;
List ManufactureTimeList = JsonUtil.getJsonToList(yysDayPackagePagination.getManufactureTime(), String.class);
Long fir = Long.valueOf(String.valueOf(ManufactureTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(ManufactureTimeList.get(1)));
List ManufactureTimeList = JsonUtil.getJsonToList(yysDayPackagePagination.getManufactureTime(),String.class);
Long fir = Long.valueOf(String.valueOf(ManufactureTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(ManufactureTimeList.get(1)));
yysDayPackageQueryWrapper.lambda().ge(YysDayPackageEntity::getManufactureTime, new Date(fir))
.le(YysDayPackageEntity::getManufactureTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
yysDayPackageQueryWrapper.lambda().ge(YysDayPackageEntity::getManufactureTime, new Date(fir))
.le(YysDayPackageEntity::getManufactureTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
if (ObjectUtil.isNotEmpty(yysDayPackagePagination.getProductCode())) {
yysDayPackageNum++;
if(ObjectUtil.isNotEmpty(yysDayPackagePagination.getProductCode())){
yysDayPackageNum++;
String value = yysDayPackagePagination.getProductCode() instanceof List ?
JsonUtil.getObjectToString(yysDayPackagePagination.getProductCode()) :
String.valueOf(yysDayPackagePagination.getProductCode());
yysDayPackageQueryWrapper.lambda().like(YysDayPackageEntity::getProductCode, value);
JsonUtil.getObjectToString(yysDayPackagePagination.getProductCode()) :
String.valueOf(yysDayPackagePagination.getProductCode());
yysDayPackageQueryWrapper.lambda().like(YysDayPackageEntity::getProductCode,value);
}
if (ObjectUtil.isNotEmpty(yysDayPackagePagination.getProductName())) {
yysDayPackageNum++;
if(ObjectUtil.isNotEmpty(yysDayPackagePagination.getProductName())){
yysDayPackageNum++;
String value = yysDayPackagePagination.getProductName() instanceof List ?
JsonUtil.getObjectToString(yysDayPackagePagination.getProductName()) :
String.valueOf(yysDayPackagePagination.getProductName());
yysDayPackageQueryWrapper.lambda().like(YysDayPackageEntity::getProductName, value);
JsonUtil.getObjectToString(yysDayPackagePagination.getProductName()) :
String.valueOf(yysDayPackagePagination.getProductName());
yysDayPackageQueryWrapper.lambda().like(YysDayPackageEntity::getProductName,value);
}
if (ObjectUtil.isNotEmpty(yysDayPackagePagination.getDeviceName())) {
yysDayPackageNum++;
if(ObjectUtil.isNotEmpty(yysDayPackagePagination.getDeviceName())){
yysDayPackageNum++;
String value = yysDayPackagePagination.getDeviceName() instanceof List ?
JsonUtil.getObjectToString(yysDayPackagePagination.getDeviceName()) :
String.valueOf(yysDayPackagePagination.getDeviceName());
yysDayPackageQueryWrapper.lambda().like(YysDayPackageEntity::getDeviceName, value);
JsonUtil.getObjectToString(yysDayPackagePagination.getDeviceName()) :
String.valueOf(yysDayPackagePagination.getDeviceName());
yysDayPackageQueryWrapper.lambda().like(YysDayPackageEntity::getDeviceName,value);
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total > 0) {
if (intersection.size() == 0) {
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
yysDayPackageQueryWrapper.lambda().in(YysDayPackageEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)) {
if (allSuperIDlist.size() == 0) {
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
yysDayPackageQueryWrapper.lambda().and(t -> t.in(YysDayPackageEntity::getId, finalAllSuperIDlist));
yysDayPackageQueryWrapper.lambda().and(t->t.in(YysDayPackageEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)) {
if (allRuleIDlist.size() == 0) {
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
yysDayPackageQueryWrapper.lambda().and(t -> t.in(YysDayPackageEntity::getId, finalAllRuleIDlist));
yysDayPackageQueryWrapper.lambda().and(t->t.in(YysDayPackageEntity::getId, finalAllRuleIDlist));
}
//假删除标志
yysDayPackageQueryWrapper.lambda().isNull(YysDayPackageEntity::getDeleteMark);
@ -259,102 +252,93 @@ public class YysDayPackageServiceImpl extends ServiceImpl<YysDayPackageMapper, Y
// }
// }
if ("0".equals(dataType)) {
if ((total > 0 && AllIdList.size() > 0) || total == 0) {
Page<YysDayPackageEntity> page = new Page<>(yysDayPackagePagination.getCurrentPage(), yysDayPackagePagination.getPageSize());
IPage<YysDayPackageEntity> userIPage = this.page(page, yysDayPackageQueryWrapper);
return yysDayPackagePagination.setData(userIPage.getRecords(), userIPage.getTotal());
} else {
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<YysDayPackageEntity> page=new Page<>(yysDayPackagePagination.getCurrentPage(), yysDayPackagePagination.getPageSize());
IPage<YysDayPackageEntity> userIPage=this.page(page, yysDayPackageQueryWrapper);
return yysDayPackagePagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<YysDayPackageEntity> list = new ArrayList();
return yysDayPackagePagination.setData(list, list.size());
}
} else {
}else{
return this.list(yysDayPackageQueryWrapper);
}
}
@Override
public YysDayPackageEntity getInfo(String id) {
QueryWrapper<YysDayPackageEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(YysDayPackageEntity::getId, id);
public YysDayPackageEntity getInfo(String id){
QueryWrapper<YysDayPackageEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(YysDayPackageEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(YysDayPackageEntity entity) {
public void create(YysDayPackageEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, YysDayPackageEntity entity) {
public boolean update(String id, YysDayPackageEntity entity){
return this.updateById(entity);
}
@Override
public void delete(YysDayPackageEntity entity) {
if (entity != null) {
public void delete(YysDayPackageEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/**
* i-0-1
*/
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(YysDayPackageForm form, int i) {
boolean isUp = StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id = "";
public String checkForm(YysDayPackageForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp) {
if (isUp){
id = form.getId();
}
//主表字段验证
if (StringUtil.isEmpty(form.getProductCode())) {
return "产品编码不能为空";
}
if (StringUtil.isNotEmpty(form.getProductName())) {
form.setProductName(form.getProductName().trim());
QueryWrapper<YysDayPackageEntity> productNameWrapper = new QueryWrapper<>();
productNameWrapper.lambda().eq(YysDayPackageEntity::getProductName, form.getProductName());
//假删除标志
productNameWrapper.lambda().isNull(YysDayPackageEntity::getDeleteMark);
if (isUp) {
productNameWrapper.lambda().ne(YysDayPackageEntity::getId, id);
}
if ((int) this.count(productNameWrapper) > 0) {
countRecover = "产品名称不能重复";
}
}
if (StringUtil.isEmpty(form.getModels())) {
return "规格型号不能为空";
}
if (StringUtil.isEmpty(form.getMeasurementUnit())) {
return "计量单位不能为空";
}
if(StringUtil.isEmpty(form.getDeviceName())){
return "设备名称不能为空";
}
if(StringUtil.isNotEmpty(form.getProductName())){
form.setProductName(form.getProductName().trim());
QueryWrapper<YysDayPackageEntity> productNameWrapper=new QueryWrapper<>();
productNameWrapper.lambda().eq(YysDayPackageEntity::getProductName,form.getProductName());
//假删除标志
productNameWrapper.lambda().isNull(YysDayPackageEntity::getDeleteMark);
if (isUp){
productNameWrapper.lambda().ne(YysDayPackageEntity::getId, id);
}
if((int) this.count(productNameWrapper)>0){
countRecover = "产品名称不能重复";
}
}
if(StringUtil.isEmpty(form.getModels())){
return "规格型号不能为空";
}
if(StringUtil.isEmpty(form.getMeasurementUnit())){
return "计量单位不能为空";
}
return countRecover;
}
/**
* ()
*
* @param id
* @param yysDayPackageForm
* @return
*/
* ()
* @param id
* @param yysDayPackageForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(YysDayPackageForm yysDayPackageForm, String id, boolean isSave) throws Exception {
UserInfo userInfo = userProvider.get();
public void saveOrUpdate(YysDayPackageForm yysDayPackageForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
yysDayPackageForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(YysDayPackageConstant.getFormData(), yysDayPackageForm), YysDayPackageForm.class);
generaterSwapUtil.swapDatetime(YysDayPackageConstant.getFormData(),yysDayPackageForm),YysDayPackageForm.class);
YysDayPackageEntity entity = JsonUtil.getJsonToBean(yysDayPackageForm, YysDayPackageEntity.class);
if (isSave) {
String mainId = RandomUtil.uuId();
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
entity.setVersion(0);
} else {
}else{
}
this.saveOrUpdate(entity);

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

@ -9,7 +9,7 @@ import java.util.Date;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-06
* @ 2024-08-19
*/
@Data
@TableName("yys_day_package")
@ -42,7 +42,7 @@ public class YysDayPackageEntity {
private String measurementUnit;
@TableField(value = "PLAN_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private String planNumber;
@TableField(value = "IS_CONFIRM" , updateStrategy = FieldStrategy.IGNORED)
@TableField("IS_CONFIRM")
private String isConfirm;
@TableField("F_CREATOR_TIME")
private Date creatorTime;

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

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

@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-06
* @ 2024-08-19
*/
@Data
public class YysDayPackageForm {
@ -34,7 +34,7 @@ public class YysDayPackageForm {
private BigDecimal sort;
/** 班次 **/
@JsonProperty("post")
private Object post;
private String post;
/** 开始时间 **/
@JsonProperty("startTime")
private String startTime;

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

@ -26,15 +26,9 @@
<p>{{ dataForm.deviceName }}</p>
</jnpf-form-tip-item>
</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">
<jnpf-form-tip-item label="班次" prop="post">
<p>{{ dataForm.post }} </p>
<p>{{ dataForm.post }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
@ -73,6 +67,12 @@
</JnpfNumber>
</jnpf-form-tip-item>
</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>
</template>
</el-form>
</el-row>
@ -101,17 +101,15 @@ export default {
deviceCode: "",
deviceName: '',
sort: 1,
post: "1",
post: "",
startTime: '',
endTime: '',
productCode: '',
endTime: "15:55",
productCode: "",
productName: '',
models: '',
measurementUnit: '',
planNumber: '',
},
postOptions: [{ "fullName": "旺季白班", "id": "1" }, { "fullName": "旺季晚班", "id": "2" }],
postProps: { "label": "fullName", "value": "id" },
}
},

@ -4,24 +4,6 @@
<div class="JNPF-common-page-header">
<el-page-header @back="goBack" :content="!dataForm.id ? '新建' : '编辑'" />
<div class="options">
<el-dropdown class="dropdown" placement="bottom">
<el-button style="width:70px">
<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<template v-if="dataForm.id">
<el-dropdown-item @click.native="prev" :disabled='prevDis'>
{{ '上一条' }}
</el-dropdown-item>
<el-dropdown-item @click.native="next" :disabled='nextDis'>
{{ '下一条' }}
</el-dropdown-item>
</template>
<el-dropdown-item type="primary" @click.native="dataFormSubmit(2)"
:loading="continueBtnLoading" :disabled='btnLoading'>
{{ !dataForm.id ? '确定并新增' : '确定并继续' }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"
:disabled='continueBtnLoading'>
</el-button>
@ -37,10 +19,9 @@
<el-col :span="8">
<jnpf-form-tip-item label="生产日期" prop="manufactureTime">
<JnpfDatePicker v-model="dataForm.manufactureTime"
@change="changeData('manufactureTime', -1)"
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
placeholder="请选择生产日期" clearable :style='{ "width": "100%" }' type="date"
format="yyyy-MM-dd">
@change="changeData('manufactureTime', -1)" :startTime="dateTime(false, 1, 1, '', '')"
:endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择生产日期" clearable
:style='{ "width": "100%" }' type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
@ -49,7 +30,7 @@
<JnpfPopupSelect v-model="dataForm.deviceCode" @change="changeData('deviceCode', -1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.deviceCode"
placeholder="请选择设备编码" propsValue="device_code" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='device_code' field='deviceCode'
popupType="dialog" relationField='device_name' field='deviceCode'
interfaceId="590497496266971845" :pageSize="20"
:columnOptions="deviceCodecolumnOptions" clearable :style='{ "width": "100%" }'>
</JnpfPopupSelect>
@ -58,31 +39,27 @@
<el-col :span="8">
<jnpf-form-tip-item label="设备名称" prop="deviceName">
<JnpfInput v-model="dataForm.deviceName" @change="changeData('deviceName', -1)"
placeholder="选择设备后自动带入" disabled clearable :style='{ "width": "100%" }'>
placeholder="请输入设备名称" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</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">
<jnpf-form-tip-item label="班次" prop="post">
<JnpfSelect v-model="dataForm.post" @change="changeData('post', -1)" placeholder="请选择班次"
clearable :style='{ "width": "100%" }' :options="postOptions" :props="postProps">
</JnpfSelect>
<JnpfPopupSelect v-model="dataForm.post" @change="changeData('post', -1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.post"
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>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="开始时间" prop="startTime">
<JnpfTimePicker v-model="dataForm.startTime" @change="changeData('startTime', -1)"
:startTime="time(false, 1, 1, '', 'HH:mm', '')"
:endTime="time(false, 1, 1, '', 'HH:mm', '')" placeholder="请选择开始时间" clearable
:style='{ "width": "100%" }' format="HH:mm">
:startTime="time(false, 1, 1, '', 'HH:mm', '')" :endTime="time(false, 1, 1, '', 'HH:mm', '')"
placeholder="请选择开始时间" clearable :style='{ "width": "100%" }' format="HH:mm">
</JnpfTimePicker>
</jnpf-form-tip-item>
</el-col>
@ -90,17 +67,20 @@
<el-col :span="8">
<jnpf-form-tip-item label="结束时间" prop="endTime">
<JnpfTimePicker v-model="dataForm.endTime" @change="changeData('endTime', -1)"
:startTime="time(false, 1, 1, '', 'HH:mm', '')"
:endTime="time(false, 1, 1, '', 'HH:mm', '')" placeholder="请选择结束时间" clearable
:style='{ "width": "100%" }' format="HH:mm">
:startTime="time(false, 1, 1, '', 'HH:mm', '')" :endTime="time(false, 1, 1, '', 'HH:mm', '')"
placeholder="请选择结束时间" clearable :style='{ "width": "100%" }' format="HH:mm">
</JnpfTimePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="产品编码" prop="productCode">
<JnpfInput v-model="dataForm.productCode" @change="changeData('productCode', -1)"
placeholder="请输入产品编码" clearable :style='{ "width": "100%" }'>
</JnpfInput>
<JnpfPopupSelect v-model="dataForm.productCode" @change="changeData('productCode', -1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.productCode"
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>
</el-col>
<el-col :span="8">
@ -119,9 +99,8 @@
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="计量单位" prop="measurementUnit">
<JnpfInput v-model="dataForm.measurementUnit"
@change="changeData('measurementUnit', -1)" placeholder="请输入计量单位" clearable
:style='{ "width": "100%" }'>
<JnpfInput v-model="dataForm.measurementUnit" @change="changeData('measurementUnit', -1)"
placeholder="请输入计量单位" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
@ -132,6 +111,13 @@
</JnpfInputNumber>
</jnpf-form-tip-item>
</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>
<!-- 表单结束 -->
</template>
</el-form>
@ -187,9 +173,9 @@ export default {
deviceCode: undefined,
deviceName: undefined,
sort: 1,
post: "1",
post: undefined,
startTime: undefined,
endTime: undefined,
endTime: "15:55",
productCode: undefined,
productName: undefined,
models: undefined,
@ -214,10 +200,17 @@ export default {
trigger: 'change'
},
],
deviceName: [
{
required: true,
message: '请输入设备名称',
trigger: 'blur'
},
],
post: [
{
required: true,
message: '请至少选择一个',
message: '请选择班次',
trigger: 'change'
},
],
@ -231,15 +224,15 @@ export default {
endTime: [
{
required: true,
message: '请选择结束时间',
message: '请至少选择一个',
trigger: 'change'
},
],
productCode: [
{
required: true,
message: '请输入产品编码',
trigger: 'blur'
message: '请选择产品编码',
trigger: 'change'
},
],
models: [
@ -265,8 +258,8 @@ export default {
],
},
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" }],
postProps: { "label": "fullName", "value": "id" },
postcolumnOptions: [{ "label": "班次名称", "value": "classes_name" }, { "label": "开始时间", "value": "start_time" }, { "label": "结束时间", "value": "end_time" }, { "label": "班次时长", "value": "classes_duration" },],
productCodecolumnOptions: [{ "label": "产品编码", "value": "material_id" }, { "label": "产品名称", "value": "material_name" }, { "label": "规格型号", "value": "model" }, { "label": "计量单位", "value": "unit_measurement" }, { "label": "安全库存", "value": "safety_stock" },],
childIndex: -1,
isEdit: false,
interfaceRes: {
@ -335,12 +328,40 @@ export default {
this.$emit('refreshDataList', true)
},
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) {
request({
url: '/api/example/YysDevice/queryNameByCode/' + this.dataForm.deviceCode,
method: 'get'
}).then(res => {
this.dataForm.deviceName = res.msg;
let _dataForm = { ...this.dataForm }
_dataForm.deviceName = res.msg
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

@ -196,10 +196,10 @@ export default {
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
postOptions: [{ "fullName": "旺季白班", "id": "1" }, { "fullName": "旺季晚班", "id": "2" }],
postProps: { "label": "fullName", "value": "id" },
interfaceRes: {
deviceCode: [],
post: [],
productCode: [],
},
}
},
@ -383,10 +383,10 @@ export default {
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const startDate = `${year}-${month}-01 00:00:00`;
const startDateTimestamp = new Date(startDate).getTime();
const endDate = `${year}-${month}-${new Date(year, now.getMonth() + 1, 0).getDate()}`;
const endDateTimestamp = new Date(endDate).getTime();
this.query.manufactureTime = [startDateTimestamp, endDateTimestamp];
const startDateTimestamp = new Date(startDate).getTime();
const endDate = `${year}-${month}-${new Date(year, now.getMonth() + 1, 0).getDate()}`;
const endDateTimestamp = new Date(endDate).getTime();
this.query.manufactureTime = [startDateTimestamp, endDateTimestamp];
},
initData() {
this.listLoading = true;

@ -19,7 +19,7 @@
<jnpf-form-tip-item label="产品编码" prop="productId">
<JnpfPopupSelect v-model="dataForm.productId" @change="changeData('productId', -1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.productId"
placeholder="请选择产品编码" propsValue="material_id" popupWidth="800px" popupTitle="选择数据"
placeholder="请选择产品编码" hasPage propsValue="material_id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='material_name' field='productId'
interfaceId="593079067666820933" :pageSize="20" :columnOptions="productIdcolumnOptions"
clearable :style='{ "width": "100%" }'>

Loading…
Cancel
Save