Commit 248d43c9 authored by lenovo's avatar lenovo

添加物料领用时间

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