| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.LocAroundBind; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.param.InitDeviceLocParams; |
| | | import com.zy.asrs.enums.LocStsType; |
| | | import com.zy.asrs.service.LocAroundBindService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.service.impl.LocMastServiceImpl; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Autowired |
| | | private LocAroundBindService locAroundBindService; |
| | | @Autowired |
| | | private LocMastServiceImpl locMastService; |
| | | |
| | | @RequestMapping(value = "/locAroundBind/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | @RequestMapping(value = "/locAroundBind/add/auth") |
| | | @ManagerAuth |
| | | public R add(LocAroundBind locAroundBind) { |
| | | if (Objects.isNull(locAroundBind)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | LocAroundBind aroundBind = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>().eq("b_loc_no", locAroundBind.getBLocNo())); |
| | | if (!Objects.isNull(aroundBind)) { |
| | | return R.error("工位已绑定,不能重复绑定!"); |
| | | } |
| | | |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locAroundBind.getBLocNo())); |
| | | locMast.setLocSts(LocStsType.LOC_STS_TYPE_X.type); |
| | | locMast.setDeleted(1); |
| | | locMast.setFrozen(1); |
| | | |
| | | if (!locMastService.updateById(locMast)) { |
| | | return R.error("原库禁用失败!!"); |
| | | } |
| | | locAroundBindService.insert(locAroundBind); |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestParam Map<String, Object> param) { |
| | | excludeTrash(param); |
| | | EntityWrapper<LocMast> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("frozen", 0) |
| | | .eq("deleted", 0); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | |
| | | @TableField("loc_type") |
| | | private String locType; |
| | | |
| | | @ApiModelProperty("机台名称") |
| | | @TableField("dev_name") |
| | | private String devName; |
| | | |
| | | public LocAroundBind() {} |
| | | |
| | | public LocAroundBind(Long devId,String devNo,Long bLocId,String bLocNo) { |
| | |
| | | @TableField("area_name") |
| | | private String areaName; |
| | | |
| | | @ApiModelProperty("逻辑删除 默认 0, 删除:1") |
| | | private Integer deleted; |
| | | |
| | | /** |
| | | * 是否冻结 |
| | | */ |
| | |
| | | @ApiModelProperty(value= "数量") |
| | | private Double anfme; |
| | | |
| | | @ApiModelProperty("实际数量") |
| | | @TableField("real_qty") |
| | | private Double realQty; |
| | | |
| | | /** |
| | | * 托盘条码 |
| | | */ |
| | |
| | | // 校验库位是否已绑定 |
| | | for (LocMast mast : locMasts) { |
| | | LocAroundBind aroundBind = this.selectOne(new EntityWrapper<LocAroundBind>() |
| | | .eq("dev_no", params.getDevNo()) |
| | | .eq("b_loc_no", mast.getLocNo())); |
| | | if (!Objects.isNull(aroundBind)) { |
| | | continue; |
| | |
| | | if (!this.insert(bind)) { |
| | | throw new CoolException("绑定库位失败"); |
| | | } |
| | | |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", bind.getBLocNo())); |
| | | locMast.setLocSts(LocStsType.LOC_STS_TYPE_X.type); |
| | | locMast.setDeleted(1); |
| | | locMast.setFrozen(1); |
| | | |
| | | if (!locMastService.updateById(locMast)) { |
| | | return R.error("原库禁用失败!!"); |
| | | } |
| | | |
| | | } |
| | | return R.ok("绑定库位成功"); |
| | | } |
| | |
| | | String wrkCode = null; |
| | | if (!Objects.isNull(deviceNo)) { |
| | | wrkCode = workNo + "-1"; |
| | | // ioType = 101; |
| | | ioType = 101; |
| | | generateOutStock(taskDto, userId, workNo, wrkCode, now, ioType, locMast, staDesc, deviceNo); |
| | | } else { |
| | | generateOutStock(taskDto, userId, workNo, wrkCode, now, ioType, locMast, staDesc, null); |
| | |
| | | if (Objects.isNull(locMasts)) { |
| | | throw new CoolException("暂无可用工作位!!"); |
| | | } |
| | | |
| | | LocAroundBind bLocNo = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>().eq("b_loc_no", locMasts.getLocNo())); |
| | | bLocNo.setLocType(LocStsType.LOC_STS_TYPE_R.type); |
| | | |
| | | if (!locAroundBindService.updateById(bLocNo)) { |
| | | throw new CoolException("工位预约失败!!"); |
| | | } |
| | | } |
| | | |
| | | List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locMasts.getLocNo(), 1); |
| | |
| | | # global-config: |
| | | # field-strategy: 0 |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | map-underscore-to-camel-case: true |
| | | cache-enabled: true |
| | | call-setters-on-nulls: true |
| | |
| | | return num.toFixed(2); |
| | | } |
| | | } |
| | | , { |
| | | field: 'realQty', align: 'center', title: '实际数量', hide: false, templet: function (d) { |
| | | var raw = d.realQty; |
| | | if (raw === null || raw === undefined) return ''; |
| | | if (typeof raw === 'string' && raw.trim() === '') return ''; |
| | | var num = Number(raw); |
| | | if (!isFinite(num)) return ''; |
| | | return num.toFixed(2); |
| | | } |
| | | } |
| | | , {field: 'zpallet', align: 'center', title: 'SN', hide: false} |
| | | , {field: 'specs', align: 'center', title: '规格', hide: false} |
| | | , { |
| | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">库位码: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="blocNo" placeholder="请输入库位码" lay-vertype="tips" lay-verify="required"> |
| | | <input class="layui-input" name="bLocNo" placeholder="请输入库位码" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |