| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.CheckRecord; |
| | | import com.zy.asrs.service.CheckRecordService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.CheckRecord; |
| | | import com.zy.asrs.service.CheckRecordService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | public class CheckRecordController extends BaseController { |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/checkRecord/auditing/auth") |
| | | @ManagerAuth |
| | | public R auditing(Long id){ |
| | | CheckRecord checkRecord = checkRecordService.selectById(id); |
| | | if (Cools.isEmpty(checkRecord)) { |
| | | return R.error(); |
| | | } |
| | | checkRecord.setStatus(1); |
| | | if (!checkRecordService.updateById(checkRecord)) { |
| | | return R.error(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/checkRecord/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools; |
| | | import com.zy.common.utils.Synchro; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("asr_check_record") |
| | | public class CheckRecord implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 库位号 |
| | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 状态 1: 已审核 0: 未审核 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 已审核 0: 未审核 ") |
| | | private Integer status; |
| | | |
| | | public CheckRecord() {} |
| | | |
| | | public CheckRecord(String locNo,String barcode,String matnr,String maktx,String specs,String batch,Double anfme,Double confirmQty,Date createTime) { |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return "已审核"; |
| | | case 0: |
| | | return "未审核"; |
| | | default: |
| | | return String.valueOf(this.status); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.CheckRecord"> |
| | | <id column="id" property="id" /> |
| | | <result column="loc_no" property="locNo" /> |
| | | <result column="barcode" property="barcode" /> |
| | | <result column="matnr" property="matnr" /> |
| | |
| | | ,{field: 'anfme', align: 'center',title: '盘点前数量'} |
| | | ,{field: 'confirmQty', align: 'center',title: '盘点确认量'} |
| | | ,{field: 'adjQty$', align: 'center',title: '盘点差异量'} |
| | | ,{field: 'createTime$', align: 'center',title: '记录时间'} |
| | | ,{field: 'createTime$', align: 'center',title: '记录时间', width: 180} |
| | | ,{field: 'type', align: 'center',title: '财务审核', templet: '#statusTpl', width: 100} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | | request: { |
| | |
| | | case "del": |
| | | del([data.locNo]); |
| | | break; |
| | | case "auditing": |
| | | layer.confirm('确定审核通过?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/checkRecord/auditing/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {id: data.id}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | break |
| | | } |
| | | }); |
| | | |
| | |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">财务审核:</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="status"> |
| | | <option value="">选择状态</option> |
| | | <option value="0">未审核</option> |
| | | <option value="1">已审核</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="search" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | {{# if( d.status === 0 ){ }} |
| | | <a class="layui-btn layui-btn-xs" lay-event="auditing">财务审核</a> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="statusTpl"> |
| | | {{# if( d.status === 1 ){ }} |
| | | <span name="status" class="layui-badge layui-badge-green">已审核</span> |
| | | {{# } else if(d.status === 0){ }} |
| | | <span name="status" class="layui-badge layui-badge-red">未审核</span> |
| | | {{# } }} |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |