修改 出库统计

master
wanghao 1 week ago
parent 128512ca2a
commit 6fadcf9d31

@ -207,6 +207,7 @@ public class ApiController {
List<StockDto> list = JSONObject.parseArray(json, StockDto.class);
if (list != null && !list.isEmpty()) {
locationCode=list.get(0).getLocationCode();
apiService.deleteInspectionInfo(locationCode, inspectionId);
apiService.insertInspectionInfo(list, inspectionId);
}

@ -61,7 +61,6 @@ public class RecordInspectionController extends BaseController {
public AjaxResult print(String ids) {
System.out.println(ids);
List<RecordInspection> list = recordInspectionService.selectListByids(ids);
List<RecordInspectionTask> infolist=iRecordInspectionTaskService.selectTaskInfoByInspectionId(ids);
Map<String,List> map=new HashMap<String,List>();
map.put("list",list);

@ -25,7 +25,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
*
* @author wangh
* @date 2024-01-18
*/
@ -56,13 +56,26 @@ public class RecordOutController extends BaseController
@RequiresPermissions("manage:record_out:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(RecordOut recordOut)
public TableDataInfo list(RecordOutSort recordOutSort)
{
startPage();
List<RecordOut> list = recordOutService.selectRecordOutList(recordOut);
// List<RecordOut> list = recordOutService.selectRecordOutList(recordOut);
List<RecordOutSort> list=recordOutService.selectCountRecord(recordOutSort);
return getDataTable(list);
}
@PostMapping("/childList")
@ResponseBody
public TableDataInfo list(RecordOut recordOut)
{
// startPage();
// List<RecordOut> list = recordOutService.selectRecordOutList(recordOut);
List<RecordOutSort> list=recordOutService.selectRecordOutChildList(recordOut);
return getDataTable(list);
}
/**
*
*/

@ -1,10 +1,14 @@
package com.ruoyi.manage.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import javax.xml.crypto.Data;
import java.util.Date;
/**
* record_out
*
@ -14,7 +18,8 @@ import com.ruoyi.common.core.domain.BaseEntity;
public class RecordOutSort extends BaseEntity
{
private static final long serialVersionUID = 1L;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date createTime;
/** 机位码 */
@Excel(name = "机位码")
private String locationCode;
@ -37,6 +42,15 @@ public class RecordOutSort extends BaseEntity
return recordCount;
}
@Override
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public void setRecordCount(int recordCount) {
this.recordCount = recordCount;
}

@ -77,4 +77,8 @@ public interface RecordOutMapper
* @return
*/
public List<RecordOut> selectByLocationCode(String locationCode);
List<RecordOutSort> selectCountRecord(RecordOutSort recordOutSort);
List<RecordOutSort> selectRecordOutChildList(RecordOut recordOut);
}

@ -76,4 +76,8 @@ public interface IRecordOutService
* @return
*/
public List<RecordOut> selectByLocationCode(String locationCode);
List<RecordOutSort> selectRecordOutChildList(RecordOut recordOut);
List<RecordOutSort> selectCountRecord(RecordOutSort recordOutSort);
}

@ -113,4 +113,15 @@ public class RecordOutServiceImpl implements IRecordOutService {
public List<RecordOut> selectByLocationCode(String locationCode) {
return recordOutMapper.selectByLocationCode(locationCode);
}
@Override
public List<RecordOutSort> selectRecordOutChildList(RecordOut recordOut) {
return recordOutMapper.selectRecordOutChildList(recordOut);
}
@Override
public List<RecordOutSort> selectCountRecord(RecordOutSort recordOutSort) {
return recordOutMapper.selectCountRecord(recordOutSort);
}
}

@ -47,8 +47,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT batch_code, create_time, COUNT(*) AS record_count
FROM record_in
<where>
<if test="params.beginCheckTime != null and params.beginCheckTime != '' and params.endCheckTime != null and params.endCheckTime != ''"> and create_time between #{params.beginCheckTime} and #{params.endCheckTime}</if><if test="batchCode != null and batchCode != ''"> and batch_code = #{batchCode}</if>
<if test="batchCode != null and batchCode != ''"> and batch_code = #{batchCode}</if>
<if test="params.beginCheckTime != null and params.beginCheckTime != '' and params.endCheckTime != null and params.endCheckTime != ''">
and create_time between #{params.beginCheckTime} and date(#{params.endCheckTime})+1
</if>
<if test="batchCode != null and batchCode != ''">and batch_code = #{batchCode}</if>
<if test="batchCode != null and batchCode != ''">and batch_code = #{batchCode}</if>
</where>
GROUP BY batch_code
ORDER BY batch_code

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.manage.mapper.RecordOutMapper">
<resultMap type="RecordOut" id="RecordOutResult">
<result property="objid" column="objid" />
<result property="epcCode" column="epc_code" />
@ -12,13 +12,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
</resultMap>
<resultMap type="RecordOutSort" id="RecordOutSortResult">
<!-- <result property="objid" column="objid" />-->
<resultMap type="com.ruoyi.manage.domain.RecordOutSort" id="RecordOutSortResult">
<result property="locationCode" column="location_code" />
<!-- <result property="createTime" column="create_time" />-->
<result property="createTime" column="create_time" />
<result property="createTime" column="createTime" />
<result property="recordCount" column="record_count" />
<!-- <result property="remark" column="remark" />-->
<!-- <result property="createBy" column="create_by" />-->
</resultMap>
<sql id="selectRecordOutVo">
select objid, epc_code, location_code, use_user, create_by, create_time from record_out
@ -26,13 +24,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectRecordOutList" parameterType="RecordOut" resultMap="RecordOutResult">
<include refid="selectRecordOutVo"/>
<where>
<where>
<if test="epcCode != null and epcCode != ''"> and epc_code = #{epcCode}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="useUser != null and useUser != ''"> and use_user = #{useUser}</if>
</where>
</select>
<select id="selectRecordOutByObjid" parameterType="Long" resultMap="RecordOutResult">
<include refid="selectRecordOutVo"/>
where objid = #{objid}
@ -84,10 +82,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteRecordOutByObjids" parameterType="String">
delete from record_out where objid in
delete from record_out where objid in
<foreach item="objid" collection="array" open="(" separator="," close=")">
#{objid}
</foreach>
</delete>
<select id="selectCountRecord" resultMap="RecordOutSortResult">
select date(create_time) as createTime, count(objid) as record_count
from record_out
<where>
<if test="params.beginCheckTime != null and params.beginCheckTime != '' and params.endCheckTime != null and params.endCheckTime != ''">
and create_time between #{params.beginCheckTime} and date( #{params.endCheckTime})+1
</if>
</where>
group by createTime;
</select>
<select id="selectRecordOutChildList" resultMap="RecordOutResult" parameterType="RecordOut">
select objid, epc_code, location_code, use_user, create_by, create_time from record_out
where date (create_time) = #{createTime}
</select>
</mapper>

@ -189,10 +189,10 @@
field: 'epcCode',
title: 'RFID编码'
},
// {
// field: 'batchCode',
// title: '批次码'
// },
{
field: 'batchCode',
title: '批次码'
},
{
field: 'recordCount',
title: '数量',

@ -137,7 +137,7 @@
<div style="height: 100%;display: flex; flex-direction: column;justify-content: space-between;">
<div><span style="display: inline-block;width: 70px;text-align: right">机坪名称: </span><span style="display: inline-block;width:12px; "> </span>${data[0].areaName || ''}</div>
<div><span style="display: inline-block;width: 70px;text-align: right">机位码: </span><span style="display: inline-block;width:12px; "> </span>${data[0].planePosition || ''}</div>
<div><span style="display: inline-block;width: 70px;text-align: right">完成状态: </span><span style="display: inline-block;width:12px; "> </span>${data[0].taskState || ''}</div>
<div><span style="display: inline-block;width: 70px;text-align: right">巡检状态: </span><span style="display: inline-block;width:12px; "> </span>${data[0].taskState || ''}</div>
</div>
</div>
<div class="right" ${data.length >2 ? `style="width:calc(75% - 2px)"`:''}>

@ -184,7 +184,7 @@
var arrays = $.table.selectColumns("inspectionId");
$.modal.open('打印','/manage/record_inspection/printHtml?ids='+arrays.toString(),1200,800);
// alert(arrays);
var data = {"ids": arrays.toString()};
// var data = {"ids": arrays.toString()};
// $.operate.submit(prefix + "/print", "get", "json", data);
// $.get(prefix + "/print",data,(e)=>{
// console.log(e)

@ -10,7 +10,7 @@
<form id="formId">
<div class="select-list">
<ul>
<li>
<!-- <li>
<label>RFID</label>
<input type="text" name="epcCode"/>
</li>
@ -22,7 +22,16 @@
<li>
<label>领用人:</label>
<input type="text" name="useUser"/>
</li>-->
<li class="select-time">
<label>出库时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间"
name="params[beginCheckTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间"
name="params[endCheckTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
@ -65,49 +74,73 @@
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "轮挡出库记录",
detailView: true,
onExpandRow: function (index, row, $detail) {
initChildTable(index, row, $detail);
},
sortName:"createTime" ,
sortOrder: "desc",
columns: [{
checkbox: true
},
{
field: 'objid',
title: '主键',
visible: false
},
{
field: 'epcCode',
title: 'RFID编码'
},
{
field: 'locationCode',
title: '机位码'
},
{
field: 'useUser',
title: '领用人'
},
{
field: 'createBy',
title: '出库人'
},
{
field: 'createTime',
title: '出库时间'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.objid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.objid + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
{
field: 'createTime',
title: '出库时间'
}, {
field: 'recordCount',
title: '数量'
},
]
};
$.table.init(options);
});
initChildTable = function (index, row, $detail) {
var childTable = $detail.html('<table style="table-layout:fixed"></table>').find('table');
$(childTable).bootstrapTable({
url: prefix + "/childList",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams: {
createTime: row.createTime
},
columns: [
{
title: '序号',
formatter: function (value, row, index) {
return index+1
}
},
{
field: 'objid',
title: '主键',
visible: false
},
{
field: 'epcCode',
title: 'RFID编码'
},
{
field: 'locationCode',
title: '机位码'
},
{
field: 'useUser',
title: '领用人'
},
{
field: 'createBy',
title: '出库人'
},
{
field: 'createTime',
title: '出库时间'
}]
});
};
</script>
</body>
</html>
Loading…
Cancel
Save