Commit 248d43c9 authored by lenovo's avatar lenovo

添加物料领用时间

parent 2c5e4212
......@@ -106,7 +106,6 @@ public class ActSuppliesHistorydataController extends BaseController
* 添加 历史数据
*/
@PreAuthorize("@ss.hasPermi('system:historydata:addInsert')")
@Log(title = " 历史数据", businessType = BusinessType.INSERT)
@PostMapping("/addInsert")
public AjaxResult addInsert(@RequestBody List<ActSuppliesHistorydata> actSuppliesHistorydata)
{
......
......@@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.Date;
/**
* 历史数据对象 act_supplies_historydata
*
......@@ -60,6 +62,9 @@ public class ActSuppliesHistorydata extends BaseEntity
/** 是否清洗 */
private Long cleanStatus;
/**时间*/
private String date;
public void setId(Long id)
{
this.id = id;
......@@ -170,6 +175,14 @@ public class ActSuppliesHistorydata extends BaseEntity
this.cleanStatus = cleanStatus;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
package com.ruoyi.system.service.impl;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
......@@ -109,10 +112,25 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
SysUser user = SecurityUtils.getLoginUser().getUser();
ActSuppliesHistorydata actSuppliesHistorydata1 = new ActSuppliesHistorydata();
for (int i=0;i<actSuppliesHistorydata.size();i++){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
try {
Date parse = simpleDateFormat.parse(actSuppliesHistorydata.get(i).getDate());
String format = simpleDateFormat.format(parse);
actSuppliesHistorydata.get(i).setDate(format);
} catch (ParseException e) {
e.printStackTrace();
}
}
Long s = actSuppliesHistorydataMapper.selectActSuppliesHistorydatauuid(actSuppliesHistorydata.get(0).getImportUuid());
if (s>0){
for (int i=0;i<actSuppliesHistorydata.size();i++) {
actSuppliesHistorydata.get(i).setCreateBy(user.getUserName());
actSuppliesHistorydata.get(i).setCreateTime(DateUtils.getNowDate());
actSuppliesHistorydataMapper.updateActSuppliesHistorydatas(actSuppliesHistorydata.get(i));
......@@ -128,6 +146,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
actSuppliesHistorydata1.setRoleId(actSuppliesHistorydata.get(i).getRoleId());
actSuppliesHistorydata1.setStatus(1L);
actSuppliesHistorydata1.setIdentifyingCode(0L);
actSuppliesHistorydata1.setDate(actSuppliesHistorydata.get(i).getDate());
actSuppliesHistorydataMapper.insertActSuppliesHistorydata(actSuppliesHistorydata1);
}
......@@ -138,6 +157,7 @@ public class ActSuppliesHistorydataServiceImpl implements IActSuppliesHistorydat
actSuppliesHistorydata1.setTemplateId(actSuppliesHistorydata.get(0).getTemplateId());
actSuppliesHistorydata1.setStatus(1L);
actSuppliesHistorydata1.setIdentifyingCode(1L);
actSuppliesHistorydata1.setDate(actSuppliesHistorydata.get(0).getDate());
actSuppliesHistorydataMapper.insertActSuppliesHistorydata(actSuppliesHistorydata1);
for (int i=0;i<actSuppliesHistorydata.size();i++){
......
......@@ -61,7 +61,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
</trim>
<if test="date != null">date,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="importUuid != null">#{importUuid},</if>
<if test="templateId != null">#{templateId},</if>
......@@ -74,7 +75,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
<if test="date != null">#{date},</if>
</trim>
</insert>
<update id="updateActSuppliesHistorydata" parameterType="ActSuppliesHistorydata">
......@@ -130,6 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status = #{status},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="date != null">date = #{date},</if>
</trim>
<where>
import_uuid = #{importUuid}
......
<template>
<div class="app-container">
<el-form ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form ref="queryForm" size="small" :inline="true" :rules="rules" label-width="68px">
<el-form-item label="模板" prop="name" >
<el-select v-model="selectedOption" ref="mySelect" size="mini" @change="handleOptionChange" filterable placeholder="请选择您要查看的模板">
<!-- <el-option label="自设的模板名" value="使用空白模板"></el-option>-->
......@@ -9,13 +9,20 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="规则" prop="rule">
<el-form-item label="规则" prop="roleid">
<el-select v-model="selectedRule" ref="mySelect" size="mini" @change="handleRuleChange" filterable placeholder="请选择您要查看的规则" >
<el-option
v-for="iem in luckyrule" :key="iem.id" :label="iem.roleName" :value="iem.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="时间" prop="date">
<el-date-picker
v-model="from.date"
type="month"
placeholder="选择月">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
......@@ -43,7 +50,7 @@
:disabled="disableNextButton"
:show-file-list=false
>
<el-button plain size="mini" icon="el-icon-download" type="primary" :disabled="disableNextButton" >导入</el-button>
<el-button plain size="mini" icon="el-icon-download" type="primary" :disabled="disableNextButton" @click="rulesdate">导入</el-button>
</el-upload>
</el-col>
</el-row>
......@@ -116,6 +123,7 @@ export default {
queryParams: {
status:0
},
};
},
created() {
......@@ -128,6 +136,16 @@ export default {
fileName="新建XLSX工作表";
},
methods:{
/** 判断是否选择时间*/
rulesdate(){
if (this.from.date==''||this.from.date==null){
this.$message.error('请选择时间日期!');
}
},
/** 页面刷新时展示的数据*/
getList() {
listSuppliesTemplate(this.queryParams).then(response => {
......@@ -301,6 +319,7 @@ export default {
},
/** 导入事件*/
async handleFileChange(evt) {
debugger
if(modify){
this.$confirm('再次导入将会清空表内数据,是否继续操作?', '注意!!!', {
confirmButtonText: '确定',
......@@ -1166,11 +1185,20 @@ export default {
this.dfrom.historyName=name+'(导入文件)';
this.dfrom.historyContent=str;
this.dfrom.identifyingCode=0;
let date = new Date(this.from.date);
let fullYear = date.getFullYear();
let month = ("0" + (date.getMonth() + 1)).slice(-2);
let datastr = fullYear +"-"+ month;
let date1 = new Date(datastr);
this.dfrom.date = date1
this.from.status=this.dfrom.status=0;
list.push(this.dfrom);
this.from.historyName=fileName+'(生成文件)';
this.from.historyContent=strsheet;
this.from.identifyingCode=1;
this.from.date = date1;
list.push(this.from);
addInsert(list).then(response=>{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment