自动化立体仓库 - WMS系统
#
zhou zhou
2025-12-26 221fc4d27eee086473de9d5b6d7150843e1c6e6d
#
7个文件已修改
114 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/HalfBarcodeController.java 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/ImagePreviewController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/HalfBarcodeMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/HalfBarcodeService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/HalfBarcodeServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/HalfBarcodeMapper.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/HalfBarcodeController.java
@@ -1,5 +1,7 @@
package com.zy.asrs.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.core.annotations.ManagerAuth;
@@ -8,39 +10,87 @@
import com.core.common.R;
import com.zy.asrs.entity.HalfBarcode;
import com.zy.asrs.entity.MatBarcode;
import com.zy.asrs.mapper.MatBarcodeMapper;
import com.zy.asrs.service.HalfBarcodeService;
import com.zy.asrs.service.MatBarcodeService;
import com.zy.common.web.BaseController;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@RestController
@RequestMapping
public class HalfBarcodeController extends BaseController {
    @Autowired
    private HalfBarcodeService halfBarcodeService;
    @Autowired
    private MatBarcodeService matBarcodeService;
    /*
     * 物料托盘绑定分页查询
     * */
//    @RequestMapping(value = "/halfBarcode/list/auth")
//    @ManagerAuth
//    public R list(@RequestParam(defaultValue = "1")Integer curr,
//                  @RequestParam(defaultValue = "10")Integer limit,
//                  @RequestParam(required = false)String orderByField,
//                  @RequestParam(required = false)String orderByType,
//                  @RequestParam Map<String, Object> param) {
//        excludeTrash(param);
//        EntityWrapper<HalfBarcode> wrapper = new EntityWrapper<>();
//        convert(param, wrapper);
//        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
//        else {
//            wrapper.orderBy("modi_time", false);
//        }
//        return R.ok(halfBarcodeService.selectPage(new Page<>(curr, limit), wrapper));
//    }
    @RequestMapping(value = "/halfBarcode/list/auth")
    @ManagerAuth
    public R list(@RequestParam(defaultValue = "1")Integer curr,
    // @ManagerAuth
    public R list2(@RequestParam(defaultValue = "1") Integer curr,
                  @RequestParam(defaultValue = "10")Integer limit,
                  @RequestParam(required = false)String orderByField,
                  @RequestParam(required = false)String orderByType,
                  @RequestParam Map<String, Object> param) {
        excludeTrash(param);
        EntityWrapper<HalfBarcode> wrapper = new EntityWrapper<>();
        convert(param, wrapper);
        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
        else {
            wrapper.orderBy("modi_time", false);
        HalfBarcode halfBarcode = JSONObject.parseObject(JSON.toJSONString(param),HalfBarcode.class);
        Page<HalfBarcode> page1 = new Page<>(curr, limit);
        Page<HalfBarcode> page = halfBarcodeService.getPage(halfBarcode, page1);
        for (HalfBarcode halfBarcode1 : page.getRecords()) {
            List<MatBarcode> matBarcodes = matBarcodeService
                    .selectList(new EntityWrapper<MatBarcode>().eq("zpallet", halfBarcode1.getZpallet()));
            // 计算所有specs字段中*后面的数字之和
            int specsSum = 0;
            for (MatBarcode matBarcode : matBarcodes) {
                String specs = matBarcode.getSpecs();
                if (specs != null && specs.contains("*")) {
                    try {
                        String afterStar = specs.substring(specs.indexOf("*") + 1);
                        specsSum += Integer.parseInt(afterStar.trim());
                    } catch (NumberFormatException e) {
                        // 忽略无法解析的specs
        }
        return R.ok(halfBarcodeService.selectPage(new Page<>(curr, limit), wrapper));
                }
            }
            int thickness = 0;
            if (Integer.parseInt(halfBarcode1.getZpallet().substring(0,1))==6){
                thickness = 2650;
            }else if(Integer.parseInt(halfBarcode1.getZpallet().substring(0,1))==7){
                thickness = 1750;
            }else if(Integer.parseInt(halfBarcode1.getZpallet().substring(0,1))==8){
                thickness = 800;
            }
            halfBarcode1.setPrice(thickness - specsSum);
        }
        return R.ok(page);
    }
    private void convert(Map<String, Object> map, EntityWrapper wrapper){
src/main/java/com/zy/asrs/controller/ImagePreviewController.java
@@ -1,7 +1,6 @@
package com.zy.asrs.controller;
import com.core.common.R;
import com.sun.prism.Image;
import com.zy.asrs.entity.ImageView;
import com.zy.asrs.utils.ImagePreviewUtils;
import com.zy.common.web.BaseController;
src/main/java/com/zy/asrs/mapper/HalfBarcodeMapper.java
@@ -1,10 +1,14 @@
package com.zy.asrs.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.zy.asrs.entity.HalfBarcode;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
@Repository
@@ -13,4 +17,6 @@
    HalfBarcode selectByZpallet(String zpallet);
    boolean half(HalfBarcode halfBarcode);
    List<HalfBarcode> getList(Page<HalfBarcode> page1, HalfBarcode halfBarcode);
}
src/main/java/com/zy/asrs/service/HalfBarcodeService.java
@@ -1,10 +1,15 @@
package com.zy.asrs.service;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.zy.asrs.entity.HalfBarcode;
import java.util.Map;
public interface HalfBarcodeService extends IService<HalfBarcode> {
    HalfBarcode selectByZpallet(String zpallet);
    boolean half(HalfBarcode halfBarcode);
    Page<HalfBarcode> getPage(HalfBarcode halfBarcode, Page<HalfBarcode> page1);
}
src/main/java/com/zy/asrs/service/impl/HalfBarcodeServiceImpl.java
@@ -1,11 +1,15 @@
package com.zy.asrs.service.impl;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.zy.asrs.entity.HalfBarcode;
import com.zy.asrs.mapper.HalfBarcodeMapper;
import com.zy.asrs.service.HalfBarcodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service("HalfBarcodeService")
public class HalfBarcodeServiceImpl extends ServiceImpl<HalfBarcodeMapper, HalfBarcode> implements HalfBarcodeService {
@@ -20,4 +24,11 @@
    public boolean half(HalfBarcode halfBarcode) {
        return halfBarcodeMapper.half(halfBarcode);
    }
    @Override
    public Page<HalfBarcode> getPage(HalfBarcode halfBarcode, Page<HalfBarcode> page1) {
        List<HalfBarcode> list = this.halfBarcodeMapper.getList(page1, halfBarcode);
        page1.setRecords(list);
        return page1;
    }
}
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -298,9 +298,9 @@
                    List<WrkDetl> wrkDetls54 = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo()));
                    if (wrkDetls54.isEmpty()) {
//                        exceptionHandle("并板入库 ===>> 工作明细档为空;[workNo={0}]", wrkMast.getWrkNo());
                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
//                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                        return FAIL.setMsg("并板入库 ===>> 工作明细档为空; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]");
                    }
                    }else {
                    // 修改库存明细数量,如无库存,曾新增
                    for (WrkDetl wrkDetl : wrkDetls54) {
@@ -377,6 +377,8 @@
                            }
                        }
                    }
                    }
                    // 修改库位状态 Q ====>> F
                    if (locMast.getLocSts().equals("Q")) {
                        locMast.setLocSts("F");
src/main/resources/mapper/HalfBarcodeMapper.xml
@@ -10,6 +10,19 @@
        <result column="specs" property="specs" />
    </resultMap>
    <sql id="PageCondition">
        <if test="zpallet != null and zpallet != '' ">
            and zpallet like '%' + #{zpallet} + '%'
        </if>
        <if test="specs !=null and specs!='' ">
            and zpallet like  #{specs} + '%'
        </if>
        <if test="price!=null and price!='' ">
            and price like '%' + #{price} + '%'
        </if>
    </sql>
    <update id="half" parameterType="com.zy.asrs.entity.HalfBarcode">
        UPDATE cust_half_barcode
        <set>
@@ -22,4 +35,10 @@
        </set>
        WHERE zpallet = #{zpallet}
    </update>
    <select id="getList" resultType="com.zy.asrs.entity.HalfBarcode">
        select zpallet,sum(1) as anfme from cust_matnr_barcode
        where 1=1
        <include refid="PageCondition"></include>
        group by zpallet
    </select>
</mapper>