Commit bc5e7485 authored by 耿迪迪's avatar 耿迪迪

日用气量上报

parent 2e18dcdb
......@@ -99,11 +99,26 @@ public class TSupBalUsgDayController extends BaseController
/**
* 获取上报信息
* @param companyId 企业id
* @param reportDate 上报时间
* @param calendarDate 上报时间
* @return
*/
@GetMapping(value = "/getReportInfoByCompany")
public AjaxResult getReportInfoByCompany(@RequestParam(value="companyId")String companyId, @RequestParam(value="reportDate")String reportDate){
return AjaxResult.success(tSupBalUsgDayService.getReportInfoByCompany(companyId,reportDate));
public AjaxResult getReportInfoByCompany(@RequestParam(value="companyId")String companyId, @RequestParam(value="calendarDate")String calendarDate){
return AjaxResult.success(tSupBalUsgDayService.getReportInfoByCompany(companyId,calendarDate));
}
/**
* 上传日用气量记录
* @param fRepUsgDayId 监管记录主键
* @return
*/
@GetMapping("/reportSupBalGasDayRecInfo")
public AjaxResult reportSupBalGasDayRecInfo(Long fRepUsgDayId){
try{
return toAjax(tSupBalUsgDayService.reportSupBalGasDayRecInfo(fRepUsgDayId));
}catch (Exception e){
logger.error("上传日用气量记录接口异常=====",e);
return AjaxResult.error("上传日用气量记录接口异常");
}
}
}
......@@ -121,6 +121,26 @@ public class TSupBalUsgDay extends BaseEntity
private String endRepDate;
/** 日历日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "日历日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date fCalendarDate;
/** 政府端上报状态0-未上报,1-已上报,默认0 */
@Excel(name = "政府端上报状态0-未上报,1-已上报,默认0")
private String fGovUploadStatus;
/** 政府端上报时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "政府端上报时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date fGovUploadTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date beginCurrentMonthDate;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endCurrentMonthDate;
public void setfRepUsgDayId(Long fRepUsgDayId)
{
this.fRepUsgDayId = fRepUsgDayId;
......@@ -372,6 +392,46 @@ public class TSupBalUsgDay extends BaseEntity
this.endRepDate = endRepDate;
}
public Date getfCalendarDate() {
return fCalendarDate;
}
public void setfCalendarDate(Date fCalendarDate) {
this.fCalendarDate = fCalendarDate;
}
public String getfGovUploadStatus() {
return fGovUploadStatus;
}
public void setfGovUploadStatus(String fGovUploadStatus) {
this.fGovUploadStatus = fGovUploadStatus;
}
public Date getfGovUploadTime() {
return fGovUploadTime;
}
public void setfGovUploadTime(Date fGovUploadTime) {
this.fGovUploadTime = fGovUploadTime;
}
public Date getBeginCurrentMonthDate() {
return beginCurrentMonthDate;
}
public void setBeginCurrentMonthDate(Date beginCurrentMonthDate) {
this.beginCurrentMonthDate = beginCurrentMonthDate;
}
public Date getEndCurrentMonthDate() {
return endCurrentMonthDate;
}
public void setEndCurrentMonthDate(Date endCurrentMonthDate) {
this.endCurrentMonthDate = endCurrentMonthDate;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -64,8 +64,15 @@ public interface ITSupBalUsgDayService
/**
* 获取上报信息
* @param companyId 企业id
* @param reportDate 上报时间
* @param calendarDate 上报时间
* @return
*/
TSupBalUsgDay getReportInfoByCompany(String companyId, String reportDate);
TSupBalUsgDay getReportInfoByCompany(String companyId, String calendarDate);
/**
* 上传日用气量记录
* @param fRepUsgDayId 监管记录主键
* @return
*/
int reportSupBalGasDayRecInfo(Long fRepUsgDayId);
}
......@@ -108,12 +108,25 @@ public class TSupBalUsgDayServiceImpl implements ITSupBalUsgDayService
* @return
*/
@Override
public TSupBalUsgDay getReportInfoByCompany(String companyId, String reportDate) {
public TSupBalUsgDay getReportInfoByCompany(String companyId, String calendarDate) {
Map<String,String> param = new HashMap();
param.put("companyId",companyId);
param.put("reportDate",reportDate);
param.put("calendarDate",calendarDate);
return tSupBalUsgDayMapper.getReportInfoByCompany(param);
}
/**
* 上传日用气量记录
* @param fRepUsgDayId 监管记录主键
* @return
*/
@Override
public int reportSupBalGasDayRecInfo(Long fRepUsgDayId){
TSupBalUsgDay tSupBalUsgDay = new TSupBalUsgDay();
tSupBalUsgDay.setfRepUsgDayId(fRepUsgDayId);
tSupBalUsgDay.setfGovUploadTime(new Date());
tSupBalUsgDay.setfGovUploadStatus("1");
return tSupBalUsgDayMapper.updateTSupBalUsgDay(tSupBalUsgDay);
}
}
......@@ -30,6 +30,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="fCreateTime" column="f_create_time" />
<result property="fUpdateTime" column="f_update_time" />
<result property="fReportStatus" column="f_report_status" />
<result property="fCalendarDate" column="f_calendar_date" />
<result property="fGovUploadStatus" column="f_gov_upload_status" />
<result property="fGovUploadTime" column="f_gov_upload_time" />
</resultMap>
<sql id="selectTSupBalUsgDayVo">
......@@ -59,6 +62,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
da.f_create_time,
da.f_update_time,
da.f_report_status,
da.f_calendar_date,
da.f_gov_upload_status,
da.f_gov_upload_time,
en.enterprise_name AS enterpriseName
FROM
t_sup_bal_usg_day da
......@@ -69,9 +75,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectTSupBalUsgDayVo"/>
<where>
<if test="fCompanyInfoId != null and fCompanyInfoId != ''"> and da.f_company_info_id = #{fCompanyInfoId}</if>
<if test="beginRepDate != null and endRepDate != null">and da.f_report_time between #{beginRepDate} and #{endRepDate}</if>
<if test="beginRepDate != null and endRepDate != null">and da.f_gov_upload_time between #{beginRepDate} and #{endRepDate}</if>
<if test="fReportStatus != null and fReportStatus != ''">da.f_report_status = #{fReportStatus}</if>
<if test="enterpriseName != null and enterpriseName != ''"> and en.enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="fCalendarDate != null"> and f_calendar_date = #{fCalendarDate}</if>
<if test="beginCurrentMonthDate != null and endCurrentMonthDate != null">and da.f_calendar_date between #{beginCurrentMonthDate} and #{endCurrentMonthDate}</if>
<if test="fGovUploadStatus != null and fGovUploadStatus != ''"> and da.f_gov_upload_status = #{fGovUploadStatus}</if>
<if test="fGovUploadTime != null "> and da.f_gov_upload_time = #{fGovUploadTime}</if>
</where>
order by f_create_time desc
</select>
......@@ -108,6 +118,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fCreateTime != null and fCreateTime != ''">f_create_time,</if>
<if test="fUpdateTime != null">f_update_time,</if>
<if test="fReportStatus != null and fReportStatus != ''">f_report_status,</if>
<if test="fCalendarDate != null">f_calendar_date,</if>
<if test="fGovUploadStatus != null">f_gov_upload_status,</if>
<if test="fGovUploadTime != null">f_gov_upload_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fCompanyInfoId != null and fCompanyInfoId != ''">#{fCompanyInfoId},</if>
......@@ -134,6 +147,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fCreateTime != null and fCreateTime != ''">#{fCreateTime},</if>
<if test="fUpdateTime != null">#{fUpdateTime},</if>
<if test="fReportStatus != null and fReportStatus != ''">#{fReportStatus},</if>
<if test="fCalendarDate != null">#{fCalendarDate},</if>
<if test="fGovUploadStatus != null">#{fGovUploadStatus},</if>
<if test="fGovUploadTime != null">#{fGovUploadTime},</if>
</trim>
</insert>
......@@ -164,6 +180,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fCreateTime != null and fCreateTime != ''">f_create_time = #{fCreateTime},</if>
<if test="fUpdateTime != null">f_update_time = #{fUpdateTime},</if>
<if test="fReportStatus != null and fReportStatus != ''">f_report_status = #{fReportStatus},</if>
<if test="fCalendarDate != null">f_calendar_date = #{fCalendarDate},</if>
<if test="fGovUploadStatus != null">f_gov_upload_status = #{fGovUploadStatus},</if>
<if test="fGovUploadTime != null">f_gov_upload_time = #{fGovUploadTime},</if>
</trim>
where f_rep_usg_day_id = #{fRepUsgDayId}
</update>
......@@ -181,6 +200,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getReportInfoByCompany" parameterType="Map" resultMap="TSupBalUsgDayResult">
<include refid="selectTSupBalUsgDayVo"/>
where da.f_company_info_id = #{companyId} and da.f_report_time like concat('%', #{reportDate}, '%')
where da.f_company_info_id = #{companyId} and da.f_calendar_date = #{calendarDate}
</select>
</mapper>
\ No newline at end of file
......@@ -67,3 +67,11 @@ export function getReportInfoByCompany(query) {
params: query
})
}
export function reportSupBalGasDayRecInfo(query) {
return request({
url: '/supplyBalance/day/reportSupBalGasDayRecInfo',
method: 'get',
params: query
})
}
......@@ -15,13 +15,12 @@
<el-form-item label="上报时间">
<el-date-picker
v-model="dateRangeValue"
v-model="dateRange"
size="small"
style="width: 240px"
type="daterange"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
value-format="yyyy-MM-dd HH:mm:ss"
@change="timeChange"
></el-date-picker>
</el-form-item>
......@@ -33,8 +32,8 @@
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<!--<el-button
<!--<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
......@@ -51,7 +50,7 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:day:edit']"
>修改</el-button>-->
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
......@@ -62,7 +61,7 @@
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
</el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
......@@ -76,9 +75,9 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="dayList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" :show-overflow-tooltip="true"/>
<el-table-column label="企业名称" align="center" prop="enterpriseName" width="150" />
<el-table v-loading="loading" :data="dayList">
<!--<el-table-column type="selection" width="55" align="center"/>-->
<el-table-column label="企业名称" align="center" prop="enterpriseName" width="180" :show-overflow-tooltip="true"/>
<el-table-column label="天然气总气量/wm³" align="center" prop="fGasUsage" width="150"/>
<el-table-column label="天然气城镇居民用量/wm³" align="center" prop="fUrbanGasUsage" width="180">
<template slot-scope="scope">
......@@ -105,7 +104,19 @@
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="上报时间" align="center" prop="fReportTime" />
<el-table-column label="上报状态" align="center" prop="fGovUploadStatus">
<template slot-scope="scope">
<span v-if="scope.row.fGovUploadStatus == '0'">未上报</span>
<span v-else-if="scope.row.fGovUploadStatus == '1'">已上报</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="上报日期" align="center" prop="fGovUploadTime" width="180">
<template slot-scope="scope">
<span v-if="scope.row.fGovUploadTime">{{ parseTime(scope.row.fGovUploadTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<!-- <el-button
......@@ -120,12 +131,17 @@
icon="el-icon-document"
@click="handleDetail(scope.row)"
>详情</el-button>
<el-button
<!-- <el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
>删除</el-button>-->
<el-button
size="mini"
type="text"
@click="handleReport(scope.row)"
>上报</el-button>
</template>
</el-table-column>
</el-table>
......@@ -257,7 +273,7 @@
<span v-else>未上报</span>
</div>
</el-col>
<el-col :span="11" style="text-align: right">
<el-col :span="11" style="padding-left: 45px">
<div class="label-warp">上报时间</div>
<div class="value-warp">
<span v-if="reportForm.fReportTime">{{ reportForm.fReportTime }}</span>
......@@ -419,7 +435,7 @@
</template>
<script>
import { listDay, getDay, delDay, addDay, updateDay, exportDay, reportInfoList, getReportInfoByCompany } from "@/api/supplybalance/day";
import { listDay, getDay, delDay, addDay, updateDay, exportDay, reportInfoList, getReportInfoByCompany, reportSupBalGasDayRecInfo } from "@/api/supplybalance/day";
import Calendar from "@/components/Calendar";
import moment from "moment";
import DetailInfo from "./components/DetailInfo";
......@@ -479,7 +495,7 @@ export default {
],
reportForm: {},
reportDate: moment().format('YYYY-MM-DD'),
dateRangeValue: []
dateRange: []
};
},
created() {
......@@ -574,10 +590,9 @@ export default {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
console.log("this.dateRangeValue = " + this.dateRangeValue)
if (this.dateRangeValue != null) {
this.queryParams.beginRepDate = this.dateRangeValue[0];
this.queryParams.endRepDate = this.dateRangeValue[1];
if (this.dateRange != null) {
this.queryParams.beginRepDate = this.dateRange[0];
this.queryParams.endRepDate = this.dateRange[1];
} else {
this.queryParams.beginRepDate = null;
this.queryParams.endRepDate = null;
......@@ -668,23 +683,34 @@ export default {
this.resetReportForm();
this.getReportInfo();
if(val == 0){
const startOfMonth = moment(this.reportDate).startOf('month').format('YYYY-MM-DD');
const startOfMonth = moment(this.reportDate).startOf('month').format('YYYY-MM-DD HH:mm:ss');
// 获取当月结束时间
const endOfMonth = moment(this.reportDate).endOf('month').format('YYYY-MM-DD');
const endOfMonth = moment(this.reportDate).endOf('month').format('YYYY-MM-DD HH:mm:ss');
this.currentMonthReportInfo(startOfMonth,endOfMonth);
}
},
reportInfo(){
this.reportForm.fReportTime = this.reportDate;
this.reportForm.fReportStatus = '1';
this.$refs["reportForm"].validate(valid => {
if (valid) {
if (this.reportForm.fRepUsgDayId != null) {
updateDay(this.reportForm).then(response => {
this.msgSuccess("上报成功");
this.getReportInfo();
});
let that = this;
this.$confirm('当前已上报,是否确认再次上报?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
that.reportForm.fReportTime = moment().format('YYYY-MM-DD HH:mm:ss');
that.reportForm.calendarDate = that.reportDate;
that.reportForm.fReportStatus = '1';
return updateDay(that.reportForm);
}).then(() => {
that.getReportInfo();
that.msgSuccess("上报成功");
}).catch(() => {});
} else {
this.reportForm.fReportTime = moment().format('YYYY-MM-DD HH:mm:ss');
this.reportForm.fCalendarDate = this.reportDate;
this.reportForm.fReportStatus = '1';
addDay(this.reportForm).then(response => {
this.msgSuccess("上报成功");
const startOfMonth = moment(this.reportDate).startOf('month').format('YYYY-MM-DD');
......@@ -697,18 +723,18 @@ export default {
}
});
},
currentMonthReportInfo(beginRepDate,endRepDate){
reportInfoList({fCompanyInfoId:this.$store.state.user.enterpriseId,beginRepDate:beginRepDate,endRepDate:endRepDate}).then(res =>{
currentMonthReportInfo(beginCurrentMonthDate,endCurrentMonthDate){
reportInfoList({fCompanyInfoId:this.$store.state.user.enterpriseId,beginCurrentMonthDate:beginCurrentMonthDate,endCurrentMonthDate:endCurrentMonthDate}).then(res =>{
if(res.code == 200 && res.data){
this.scheduleData = [];
res.data.forEach(item =>{
this.scheduleData.push({date:item.fReportTime,content:item.fReportStatus == '1'?"已上报":"未上报"})
this.scheduleData.push({date:item.fCalendarDate,content:item.fReportStatus == '1'?"已上报":"未上报"})
})
}
})
},
getReportInfo(){
getReportInfoByCompany({companyId:this.$store.state.user.enterpriseId,reportDate:this.reportDate}).then(res =>{
getReportInfoByCompany({companyId:this.$store.state.user.enterpriseId,calendarDate:this.reportDate}).then(res =>{
if(res.code && res.data){
this.reportForm = res.data;
}
......@@ -719,6 +745,21 @@ export default {
this.$refs.detail.getDetailInfo(row.fRepUsgDayId);
},
timeChange(val){
this.queryParams.beginRepDate = val[0];
this.queryParams.endRepDate = val[1];
},
//上传
handleReport(row) {
this.$confirm('是否确认上报日用气量编号为"' + row.fRepUsgDayId + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return reportSupBalGasDayRecInfo({fRepUsgDayId : row.fRepUsgDayId});
}).then(() => {
this.getList();
this.msgSuccess("上报成功");
}).catch(() => {});
},
}
};
......
......@@ -570,9 +570,7 @@ export default {
}).then(() => {
this.getList();
this.msgSuccess("上报成功");
}).catch((e) => {
console.log("==============",e)
});
}).catch(() => {});
},
}
};
......
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