增加库位明细导出功能,曾加物料、单据、库存全局搜索功能
| | |
| | | package com.zy.asrs.common.web; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zy.asrs.common.sys.entity.User; |
| | | import com.zy.asrs.common.sys.entity.UserLogin; |
| | |
| | | return tagService.getTop(getHostId()); |
| | | } |
| | | |
| | | /** |
| | | * 全字段模糊搜索 |
| | | * @param cls 模型类 |
| | | * @param set 排除字段集合 |
| | | * @param condition 搜索内容 |
| | | */ |
| | | protected <T> void allLike(Class<T> cls, Set<String> set, QueryWrapper<T> wrapper, String condition){ |
| | | if (Cools.isEmpty(condition)) { |
| | | return; |
| | | } |
| | | final List<String> columns = new ArrayList<>(); |
| | | for (Field field :Cools.getAllFields(cls)){ |
| | | if (Modifier.isFinal(field.getModifiers()) |
| | | || Modifier.isStatic(field.getModifiers()) |
| | | || Modifier.isTransient(field.getModifiers())){ |
| | | continue; |
| | | } |
| | | String column = null; |
| | | if (field.isAnnotationPresent(TableField.class)) { |
| | | column = field.getAnnotation(TableField.class).value(); |
| | | } |
| | | if (Cools.isEmpty(column)) { |
| | | column = field.getName(); |
| | | } |
| | | if (!set.contains(column)) { |
| | | columns.add(column); |
| | | } |
| | | } |
| | | if (columns.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | wrapper.and( w -> { |
| | | for (int i=0;i<columns.size();i++){ |
| | | String colums = columns.get(i); |
| | | if (i==0){ |
| | | w.like(colums, condition); |
| | | }else { |
| | | w.or().like(colums, condition); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // for (int i=0;i<columns.size();i++){ |
| | | // String colums = columns.get(i); |
| | | // if (i==0){ |
| | | // wrapper.and(w -> w.like(colums, condition)); |
| | | // } else { |
| | | // wrapper.or(w -> w.like(colums, condition)); |
| | | // } |
| | | //// wrapper.like(columns.get(i), condition); |
| | | // } |
| | | } |
| | | |
| | | } |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.zy.asrs.common.utils.Synchro; |
| | | import com.zy.asrs.common.wms.service.DocTypeService; |
| | | import com.zy.asrs.common.wms.service.LocMastService; |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | * 库位号 |
| | | */ |
| | | @ApiModelProperty(value= "库位号") |
| | | @TableField("loc_no") |
| | | private String locNo; |
| | | |
| | | /** |
| | |
| | | private String batch; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | | /** |
| | |
| | | private String manu; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("manu_date") |
| | | private String manuDate; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("item_num") |
| | | private String itemNum; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("safe_qty") |
| | | private Double safeQty; |
| | | |
| | | @ApiModelProperty(value= "") |
| | |
| | | private Double volume; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("three_code") |
| | | private String threeCode; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | private String supp; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("supp_code") |
| | | private String suppCode; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("be_batch") |
| | | private Integer beBatch; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("dead_time") |
| | | private String deadTime; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("dead_warn") |
| | | private Integer deadWarn; |
| | | |
| | | @ApiModelProperty(value= "") |
| | |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("modi_user") |
| | | private Long modiUser; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @TableField("modi_time") |
| | | private Date modiTime; |
| | | |
| | | /** |
| | | * 创建者 |
| | | */ |
| | | @ApiModelProperty(value= "创建者") |
| | | @TableField("appe_user") |
| | | private Long appeUser; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @TableField("appe_time") |
| | | private Date appeTime; |
| | | |
| | | /** |
| | |
| | | * 授权商户 |
| | | */ |
| | | @ApiModelProperty(value= "授权商户") |
| | | @TableField("host_id") |
| | | private Long hostId; |
| | | |
| | | @ApiModelProperty(value= "货主") |
| | |
| | | import java.util.Date; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.zy.asrs.common.wms.service.TagService; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | |
| | | * 所属归类 |
| | | */ |
| | | @ApiModelProperty(value= "所属归类") |
| | | @TableField("tag_id") |
| | | private Long tagId; |
| | | |
| | | /** |
| | |
| | | * 生产日期 |
| | | */ |
| | | @ApiModelProperty(value= "生产日期") |
| | | @TableField("manu_date") |
| | | private String manuDate; |
| | | |
| | | /** |
| | | * 品项数 |
| | | */ |
| | | @ApiModelProperty(value= "品项数") |
| | | @TableField("item_num") |
| | | private String itemNum; |
| | | |
| | | /** |
| | |
| | | * 三方编码 |
| | | */ |
| | | @ApiModelProperty(value= "三方编码") |
| | | @TableField("three_code") |
| | | private String threeCode; |
| | | |
| | | /** |
| | |
| | | * 供应商编码 |
| | | */ |
| | | @ApiModelProperty(value= "供应商编码") |
| | | @TableField("supp_code") |
| | | private String suppCode; |
| | | |
| | | /** |
| | | * 保质期 |
| | | */ |
| | | @ApiModelProperty(value= "保质期") |
| | | @TableField("dead_time") |
| | | private String deadTime; |
| | | |
| | | /** |
| | |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | | @TableField("create_by") |
| | | private Long createBy; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @TableField("create_time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("update_by") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @TableField("update_time") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | |
| | | * 仓库ID |
| | | */ |
| | | @ApiModelProperty(value= "仓库ID") |
| | | @TableField("host_id") |
| | | private Long hostId; |
| | | |
| | | //念初使用以下额外字段 |
| | | //主要仓库 |
| | | @TableField("main_host") |
| | | private String mainHost; |
| | | |
| | | //主要来源 |
| | | @TableField("main_source") |
| | | private String mainSource; |
| | | |
| | | //循环盘点码 |
| | | @TableField("cycle_pick_code") |
| | | private String cyclePickCode; |
| | | |
| | | //存放位置 |
| | | @TableField("location_stock") |
| | | private String locationStock; |
| | | |
| | | //材质 |
| | |
| | | private String decrees; |
| | | |
| | | //图号 |
| | | @TableField("img_num") |
| | | private String imgNum; |
| | | |
| | | //采购单位 |
| | | @TableField("purchasing_units") |
| | | private String purchasingUnits; |
| | | |
| | | //工艺编号 |
| | | @TableField("process_number") |
| | | private String processNumber; |
| | | |
| | | //指定bom |
| | | private String bom; |
| | | |
| | | //安全存量 |
| | | @TableField("safe_num") |
| | | private String safeNum; |
| | | |
| | | //最低补量 |
| | | @TableField("mini_count") |
| | | private String miniCount; |
| | | |
| | | //补货倍量 |
| | | @TableField("replenishment_num") |
| | | private String replenishmentNum; |
| | | |
| | | //自定义1 |
| | |
| | | private String tmp3; |
| | | |
| | | //按需求补货 |
| | | @TableField("replenishment_num") |
| | | private String restockDemand; |
| | | |
| | | //失效 |
| | |
| | | private String height; |
| | | |
| | | //会计分类 |
| | | @TableField("accounting_class") |
| | | private String accountingClass; |
| | | |
| | | //批号管理 |
| | | private String batch; |
| | | |
| | | //存货核算 |
| | | @TableField("inventory_account") |
| | | private String inventoryAccount; |
| | | |
| | | |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.zy.asrs.common.wms.service.CstmrService; |
| | | import com.zy.asrs.common.wms.service.DocTypeService; |
| | | import com.zy.asrs.common.wms.service.ItemService; |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | /** |
| | | * 订单编号 |
| | | */ |
| | | @TableField("order_no") |
| | | @ApiModelProperty(value= "订单编号") |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * 单据日期 |
| | | */ |
| | | @TableField("order_time") |
| | | @ApiModelProperty(value= "单据日期") |
| | | private String orderTime; |
| | | |
| | | /** |
| | | * 单据类型 |
| | | */ |
| | | @TableField("doc_type") |
| | | @ApiModelProperty(value= "单据类型") |
| | | private Long docType; |
| | | |
| | | /** |
| | | * 项目编号 |
| | | */ |
| | | @TableField("item_id") |
| | | @ApiModelProperty(value= "项目编号") |
| | | private Long itemId; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("item_name") |
| | | private String itemName; |
| | | |
| | | /** |
| | | * 调拨项目编号 |
| | | */ |
| | | @ApiModelProperty(value= "调拨项目编号") |
| | | @TableField("allot_item_id") |
| | | private Long allotItemId; |
| | | |
| | | /** |
| | | * 初始票据号 |
| | | */ |
| | | @ApiModelProperty(value= "初始票据号") |
| | | @TableField("def_number") |
| | | private String defNumber; |
| | | |
| | | /** |
| | |
| | | * 客户 |
| | | */ |
| | | @ApiModelProperty(value= "客户") |
| | | @TableField("cstmr_name") |
| | | private String cstmrName; |
| | | |
| | | /** |
| | |
| | | * 操作人员 |
| | | */ |
| | | @ApiModelProperty(value= "操作人员") |
| | | @TableField("oper_memb") |
| | | private String operMemb; |
| | | |
| | | /** |
| | | * 合计金额 |
| | | */ |
| | | @ApiModelProperty(value= "合计金额") |
| | | @TableField("total_fee") |
| | | private Double totalFee; |
| | | |
| | | /** |
| | |
| | | * 优惠金额 |
| | | */ |
| | | @ApiModelProperty(value= "优惠金额") |
| | | @TableField("discount_fee") |
| | | private Double discountFee; |
| | | |
| | | /** |
| | | * 销售或采购费用合计 |
| | | */ |
| | | @ApiModelProperty(value= "销售或采购费用合计") |
| | | @TableField("other_fee") |
| | | private Double otherFee; |
| | | |
| | | /** |
| | | * 实付金额 |
| | | */ |
| | | @ApiModelProperty(value= "实付金额") |
| | | @TableField("act_fee") |
| | | private Double actFee; |
| | | |
| | | /** |
| | | * 付款类型 1: 现金 2: 记账 |
| | | */ |
| | | @ApiModelProperty(value= "付款类型 1: 现金 2: 记账 ") |
| | | @TableField("pay_type") |
| | | private Integer payType; |
| | | |
| | | /** |
| | |
| | | * 结算天数 |
| | | */ |
| | | @ApiModelProperty(value= "结算天数") |
| | | @TableField("account_day") |
| | | private Integer accountDay; |
| | | |
| | | /** |
| | | * 邮费支付类型 1: 在线支付 2: 货到付款 |
| | | */ |
| | | @ApiModelProperty(value= "邮费支付类型 1: 在线支付 2: 货到付款 ") |
| | | @TableField("post_fee_type") |
| | | private Integer postFeeType; |
| | | |
| | | /** |
| | | * 邮费 |
| | | */ |
| | | @ApiModelProperty(value= "邮费") |
| | | @TableField("post_fee") |
| | | private Double postFee; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiModelProperty(value= "付款时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @TableField("pay_time") |
| | | private Date payTime; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiModelProperty(value= "发货时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @TableField("send_time") |
| | | private Date sendTime; |
| | | |
| | | /** |
| | | * 物流名称 |
| | | */ |
| | | @ApiModelProperty(value= "物流名称") |
| | | @TableField("ship_name") |
| | | private String shipName; |
| | | |
| | | /** |
| | | * 物流单号 |
| | | */ |
| | | @ApiModelProperty(value= "物流单号") |
| | | @TableField("ship_code") |
| | | private String shipCode; |
| | | |
| | | /** |
| | |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | | @TableField("create_by") |
| | | private Long createBy; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @TableField("create_time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("update_by") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @TableField("update_time") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | |
| | | * 授权商户 |
| | | */ |
| | | @ApiModelProperty(value= "授权商户") |
| | | @TableField("host_id") |
| | | private Long hostId; |
| | | |
| | | public Order() {} |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zy.asrs.common.wms.entity.LocDetl; |
| | | import com.zy.asrs.common.wms.entity.Mat; |
| | | import com.zy.asrs.common.wms.entity.Order; |
| | | import com.zy.asrs.common.wms.service.LocDetlService; |
| | | import com.zy.asrs.common.wms.service.MatService; |
| | | import com.zy.asrs.framework.annotations.ManagerAuth; |
| | |
| | | return R.ok(detls); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locDetl/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(locDetlService.getById(String.valueOf(id))); |
| | | // @RequestMapping(value = "/locDetl/{id}/auth") |
| | | // @ManagerAuth |
| | | // public R get(@PathVariable("id") String id) { |
| | | // |
| | | // return R.ok(locDetlService.getById(String.valueOf(id))); |
| | | // } |
| | | |
| | | @RequestMapping(value = "/locDetl/export/auth") |
| | | @ManagerAuth(memo = "库位明细导出") |
| | | public synchronized R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | QueryWrapper<LocDetl> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("locDetl")); |
| | | String row = ""; |
| | | if (map.get("row") != null) { |
| | | String chooseRow = (String) map.get("row"); |
| | | if (chooseRow.length() == 1) { |
| | | row = "0" + chooseRow; |
| | | map.remove("row"); |
| | | }else { |
| | | row = chooseRow; |
| | | map.remove("row"); |
| | | } |
| | | } |
| | | convert(map, wrapper); |
| | | // if (!row.equals("")){ |
| | | // wrapper.and() |
| | | // .where("loc_no like '" +row +"%'"); |
| | | // } |
| | | List<LocDetl> list = locDetlService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | if (entry.getKey().equals("locNo")) { |
| | | wrapper.eq("loc_no", String.valueOf(entry.getValue())); |
| | | } else { |
| | | wrapper.like(entry.getKey(), String.valueOf(entry.getValue())); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/locDetl/page/auth") |
| | |
| | | @RequestParam(required = false) String condition, |
| | | @RequestParam(required = false) String timeRange, |
| | | @RequestParam Map<String, Object> param) { |
| | | LambdaQueryWrapper<LocDetl> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(LocDetl::getHostId, getHostId()); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(LocDetl::getLocNo, condition); |
| | | } |
| | | QueryWrapper<LocDetl> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("host_id", getHostId()); |
| | | // if (!Cools.isEmpty(condition)) { |
| | | // wrapper.like(LocDetl::getLocNo, condition); |
| | | // } |
| | | if (!Cools.isEmpty(timeRange)) { |
| | | String[] range = timeRange.split(RANGE_TIME_LINK); |
| | | wrapper.ge(LocDetl::getAppeTime, DateUtils.convert(range[0])); |
| | | wrapper.le(LocDetl::getAppeTime, DateUtils.convert(range[1])); |
| | | wrapper.ge("appe_time", DateUtils.convert(range[0])); |
| | | wrapper.le("appe_time", DateUtils.convert(range[1])); |
| | | } |
| | | if (!Cools.isEmpty(param.get("locNo"))) { |
| | | wrapper.eq(LocDetl::getLocNo, param.get("locNo")); |
| | | wrapper.eq("loc_no", param.get("locNo")); |
| | | } |
| | | param.remove("locNo"); |
| | | param.remove("owner"); |
| | | param.remove("zpallet"); |
| | | param.remove("matnr"); |
| | | allLike(LocDetl.class, param.keySet(), wrapper, condition); |
| | | return R.ok(locDetlService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zy.asrs.common.utils.TreeUtils; |
| | | import com.zy.asrs.common.wms.entity.Mat; |
| | |
| | | @RequestParam(required = false) String condition, |
| | | @RequestParam(required = false) String timeRange, |
| | | @RequestParam Map<String, Object> param) { |
| | | LambdaQueryWrapper<Mat> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Mat::getHostId, getHostId()); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(Mat::getId, condition); |
| | | } |
| | | QueryWrapper<Mat> wrapper = new QueryWrapper<>(); |
| | | // convert(param, wrapper); |
| | | wrapper.eq("host_id", getHostId()); |
| | | // if (!Cools.isEmpty(condition)) { |
| | | // wrapper.like(Mat::getId, condition); |
| | | // } |
| | | if (!Cools.isEmpty(timeRange)) { |
| | | String[] range = timeRange.split(RANGE_TIME_LINK); |
| | | wrapper.ge(Mat::getCreateTime, DateUtils.convert(range[0])); |
| | | wrapper.le(Mat::getCreateTime, DateUtils.convert(range[1])); |
| | | wrapper.ge("create_time", DateUtils.convert(range[0])); |
| | | wrapper.le("create_time", DateUtils.convert(range[1])); |
| | | } |
| | | Object tagId = param.get("tag_id"); |
| | | ArrayList<Long> nodes = new ArrayList<>(); |
| | |
| | | tagId = getOriginTag().getId(); |
| | | } |
| | | treeUtils.getTagIdList(Long.parseLong(tagId.toString()), nodes); |
| | | wrapper.in(Mat::getTagId, nodes); |
| | | wrapper.in("tag_id", nodes); |
| | | if (!Cools.isEmpty(param.get("matnr"))) { |
| | | wrapper.eq(Mat::getMatnr, param.get("matnr")); |
| | | wrapper.eq("matnr", param.get("matnr")); |
| | | } |
| | | if (!Cools.isEmpty(param.get("maktx"))) { |
| | | wrapper.eq(Mat::getMaktx, param.get("maktx")); |
| | | wrapper.eq("maktx", param.get("maktx")); |
| | | } |
| | | param.remove("matnr"); |
| | | param.remove("maktx"); |
| | | allLike(Mat.class, param.keySet(), wrapper, condition); |
| | | return R.ok(matService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | |
| | | // private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | // for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | // String val = String.valueOf(entry.getValue()); |
| | | // if (val.contains(RANGE_TIME_LINK)){ |
| | | // String[] dates = val.split(RANGE_TIME_LINK); |
| | | // wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | // wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | // } else { |
| | | // if (entry.getKey().equals("locNo")) { |
| | | // wrapper.eq("loc_no", String.valueOf(entry.getValue())); |
| | | // } else { |
| | | // wrapper.like(entry.getKey(), String.valueOf(entry.getValue())); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | |
| | | @RequestMapping(value = "/mat/add/auth") |
| | | @ManagerAuth |
| | | public R add(Mat mat) { |
| | | int count = matService.count(new LambdaQueryWrapper<Mat>().eq(Mat::getMatnr, mat.getMatnr())); |
| | | if(count > 0){ |
| | | return R.error("当前物料号已存在"); |
| | | } |
| | | mat.setHostId(getHostId()); |
| | | matService.save(mat); |
| | | return R.ok(); |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.Query; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zy.asrs.common.domain.dto.DetlDto; |
| | | import com.zy.asrs.common.domain.dto.WrkTraceVo; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | |
| | | @RequestParam(required = false) String condition, |
| | | @RequestParam(required = false) String timeRange, |
| | | @RequestParam Map<String, Object> param) { |
| | | LambdaQueryWrapper<Order> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Order::getHostId, getHostId()); |
| | | QueryWrapper<Order> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("host_id", getHostId()); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(Order::getId, condition); |
| | | wrapper.like("id", condition); |
| | | } |
| | | if (!Cools.isEmpty(timeRange)) { |
| | | String[] range = timeRange.split(RANGE_TIME_LINK); |
| | | wrapper.ge(Order::getCreateTime, DateUtils.convert(range[0])); |
| | | wrapper.le(Order::getCreateTime, DateUtils.convert(range[1])); |
| | | wrapper.ge("create_time", DateUtils.convert(range[0])); |
| | | wrapper.le("create_time", DateUtils.convert(range[1])); |
| | | } |
| | | allLike(Order.class, param.keySet(), wrapper, condition); |
| | | return R.ok(orderService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R head(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false) String condition, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param) throws UnsupportedEncodingException { |
| | | LambdaQueryWrapper<Order> wrapper = new LambdaQueryWrapper<>(); |
| | | condition = condition.trim(); |
| | | QueryWrapper<Order> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | wrapper.eq(Order::getStatus, 1); |
| | | wrapper.eq(Order::getHostId, getHostId()); |
| | | wrapper.eq("status", 1); |
| | | wrapper.eq("host_id", getHostId()); |
| | | if (!Cools.isEmpty(param.get("order_no"))) { |
| | | wrapper.eq(Order::getOrderNo, param.get("order_no")); |
| | | wrapper.eq("order_no", param.get("order_no")); |
| | | } |
| | | if (!Cools.isEmpty(param.get("create_time"))) { |
| | | String[] range = param.get("create_time").toString().split(RANGE_TIME_LINK); |
| | | wrapper.ge(Order::getCreateTime, DateUtils.convert(range[0])); |
| | | wrapper.le(Order::getCreateTime, DateUtils.convert(range[1])); |
| | | wrapper.ge("create_time", DateUtils.convert(range[0])); |
| | | wrapper.le("create_time", DateUtils.convert(range[1])); |
| | | } |
| | | if (!Cools.isEmpty(param.get("doc_type"))) { |
| | | wrapper.eq(Order::getDocType, param.get("doc_type")); |
| | | wrapper.eq("doc_type", param.get("doc_type")); |
| | | } |
| | | if (!Cools.isEmpty(param.get("docName"))) { |
| | | String docName = URLDecoder.decode(param.get("docName").toString(), "UTF-8"); |
| | | DocType docType = docTypeService.getOne(new LambdaQueryWrapper<DocType>().eq(DocType::getDocName, docName)); |
| | | wrapper.eq(Order::getDocType, docType.getDocId()); |
| | | wrapper.eq("doc_type", docType.getDocId()); |
| | | } |
| | | if (!Cools.isEmpty(param.get("settle"))) { |
| | | wrapper.eq(Order::getSettle, param.get("settle")); |
| | | wrapper.eq("settle", param.get("settle")); |
| | | } |
| | | |
| | | param.remove("order_no"); |
| | | allLike(Order.class, param.keySet(), wrapper, condition); |
| | | return R.ok(orderService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | |
| | | .doWrite(excels); |
| | | } |
| | | |
| | | // // excel导入-------判断是否有重复物料 |
| | | // @PostMapping(value = "/mat/excel/import/check/auth") |
| | | // @ManagerAuth(memo = "商品档案数据导入") |
| | | // @Transactional |
| | | // public R matExcelImportCheck(MultipartFile file) throws IOException { |
| | | // MatExcelListener listener = new MatExcelListener(getUserId(), getHostId()); |
| | | // EasyExcel.read(file.getInputStream(), MatExcel.class, listener).sheet().doRead(); |
| | | // return R.ok("成功同步"+listener.getTotal()+"条商品数据"); |
| | | // } |
| | | |
| | | // excel导入 |
| | | @PostMapping(value = "/mat/excel/import/auth") |
| | | @ManagerAuth(memo = "商品档案数据导入") |
| | |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'wrkDetlLog': exportData, |
| | | 'locDetl': exportData, |
| | | 'fields': fields |
| | | }; |
| | | |
| | | layer.load('Loading...', { |
| | | shade: [0.1,'#fff'] |
| | | }); |
| | | var loadIndex = layer.msg('正在导出...', {icon: 16, shade: 0.01, time: false}); |
| | | $.ajax({ |
| | | url: baseUrl + "/locDetl/export/auth", |
| | | url: baseUrl+"/locDetl/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | xhrFields: { |
| | | responseType: "blob" // 设置响应类型为二进制数据 |
| | | }, |
| | | success: function (res) { |
| | | // 创建一个临时的下载链接 |
| | | const url = window.URL.createObjectURL(res); |
| | | // 创建一个隐藏的 <a> 元素并设置下载链接 |
| | | const a = document.createElement("a"); |
| | | a.style.display = "none"; |
| | | a.href = url; |
| | | a.download = "export.xlsx"; // 指定下载的文件名 |
| | | document.body.appendChild(a); |
| | | |
| | | // 触发点击事件以开始下载 |
| | | a.click(); |
| | | |
| | | // 清理临时资源 |
| | | setTimeout(function () { |
| | | window.URL.revokeObjectURL(url); |
| | | document.body.removeChild(a); |
| | | layer.closeAll(); |
| | | }, 100); |
| | | }, |
| | | fail: function (){ |
| | | layer.msg('导出失败', {icon: 2}) |
| | | layer.close(loadIndex); |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | res.data.forEach((item,index) => { |
| | | if (item[0] != null) { |
| | | item[0] = "'" + item[0]; |
| | | } |
| | | if (item[1] != null) { |
| | | item[1] = "'" + item[1]; |
| | | } |
| | | if (item[2] != null) { |
| | | item[2] = "'" + item[2]; |
| | | } |
| | | }) |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | // debugger; |
| | | // layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | // var titles=[]; |
| | | // var fields=[]; |
| | | // obj.config.cols[0].map(function (col) { |
| | | // if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | // titles.push(col.title); |
| | | // fields.push(col.field); |
| | | // } |
| | | // }); |
| | | // var exportData = {}; |
| | | // $.each($('#search-box [name]').serializeArray(), function() { |
| | | // exportData[this.name] = this.value; |
| | | // }); |
| | | // var param = { |
| | | // 'wrkDetlLog': exportData, |
| | | // 'fields': fields |
| | | // }; |
| | | // |
| | | // layer.load('Loading...', { |
| | | // shade: [0.1,'#fff'] |
| | | // }); |
| | | // $.ajax({ |
| | | // url: baseUrl + "/locDetl/export/auth", |
| | | // headers: {'token': localStorage.getItem('token')}, |
| | | // data: JSON.stringify(param), |
| | | // contentType:'application/json;charset=UTF-8', |
| | | // method: 'POST', |
| | | // xhrFields: { |
| | | // responseType: "blob" // 设置响应类型为二进制数据 |
| | | // }, |
| | | // success: function (res) { |
| | | // // 创建一个临时的下载链接 |
| | | // const url = window.URL.createObjectURL(res); |
| | | // // 创建一个隐藏的 <a> 元素并设置下载链接 |
| | | // const a = document.createElement("a"); |
| | | // a.style.display = "none"; |
| | | // a.href = url; |
| | | // a.download = "export.xlsx"; // 指定下载的文件名 |
| | | // document.body.appendChild(a); |
| | | // |
| | | // // 触发点击事件以开始下载 |
| | | // a.click(); |
| | | // |
| | | // // 清理临时资源 |
| | | // setTimeout(function () { |
| | | // window.URL.revokeObjectURL(url); |
| | | // document.body.removeChild(a); |
| | | // layer.closeAll(); |
| | | // }, 100); |
| | | // }, |
| | | // fail: function (){ |
| | | // layer.msg('导出失败', {icon: 2}) |
| | | // layer.closeAll(); |
| | | // } |
| | | // }); |
| | | // }); |
| | | break; |
| | | } |
| | | }); |
| | |
| | | <input name="maktx" class="layui-input" placeholder="输入商品名称"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="search" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | |
| | | <input name="order_no" class="layui-input" type="text" placeholder="输入单据编号"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="create_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |