无关风月
2024-12-23 a1c6665c90fe7292ed2ccb3f6b3dc2a213034e3d
代码
3个文件已修改
65 ■■■■■ 已修改文件
manage/src/main/java/com/jilongda/manage/service/impl/TLensGoodsServiceImpl.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manage/src/main/java/com/jilongda/manage/vo/TLensGoodsVO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manage/src/main/resources/mapping/TLensGoods.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
manage/src/main/java/com/jilongda/manage/service/impl/TLensGoodsServiceImpl.java
@@ -1,5 +1,7 @@
package com.jilongda.manage.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jilongda.common.basic.PageInfo;
import com.jilongda.manage.mapper.SecSettingMapper;
@@ -42,6 +44,58 @@
            if (tFrameGoodsVO.getTotal() < secSetting.getLensThreshold()) {
                tFrameGoodsVO.setIsWarning(1);
            }
            switch (tFrameGoodsVO.getLensType()){
                case 1:
                    String sphere = tFrameGoodsVO.getSphere();
                    if (sphere.contains("cost")){
                        JSONArray objects = JSONObject.parseArray(sphere);
                        // 遍历这个数组
                        for (Object object : objects) {
                            JSONObject jsonObject = (JSONObject) object;
                            String cost = jsonObject.getString("refractiveIndex");
                            if (tFrameGoodsVO.getRefractiveIndex().equals(cost)){
                                tFrameGoodsVO.setSale(jsonObject.getString("sale"));
                                tFrameGoodsVO.setCost(jsonObject.getString("cost"));
                                break;
                            }
                        }
                    }
                    break;
                case 2:
                    String sphere1 = tFrameGoodsVO.getAsphericSurface();
                    if (sphere1.contains("cost")){
                        JSONArray objects = JSONObject.parseArray(sphere1);
                        // 遍历这个数组
                        for (Object object : objects) {
                            JSONObject jsonObject = (JSONObject) object;
                            String cost = jsonObject.getString("refractiveIndex");
                            if (tFrameGoodsVO.getRefractiveIndex().equals(cost)){
                                tFrameGoodsVO.setSale(jsonObject.getString("sale"));
                                tFrameGoodsVO.setCost(jsonObject.getString("cost"));
                                break;
                            }
                        }
                    }
                    break;
                case 3:
                    String sphere2 = tFrameGoodsVO.getDoubleNon();
                    if (sphere2.contains("cost")){
                        JSONArray objects = JSONObject.parseArray(sphere2);
                        // 遍历这个数组
                        for (Object object : objects) {
                            JSONObject jsonObject = (JSONObject) object;
                            String cost = jsonObject.getString("refractiveIndex");
                            if (tFrameGoodsVO.getRefractiveIndex().equals(cost)){
                                tFrameGoodsVO.setSale(jsonObject.getString("sale"));
                                tFrameGoodsVO.setCost(jsonObject.getString("cost"));
                                break;
                            }
                        }
                    }
                    break;
            }
        }
        pageInfo.setRecords(list);
        return pageInfo;
manage/src/main/java/com/jilongda/manage/vo/TLensGoodsVO.java
@@ -18,6 +18,13 @@
    private String sale;
    @ApiModelProperty(value = "成本/片")
    private String cost;
    @ApiModelProperty(value = "前端忽略json球")
    private String sphere;
    @ApiModelProperty(value = "前端忽略json非球")
    private String asphericSurface;
    @ApiModelProperty(value = "前端忽略json成本双非")
    private String doubleNon;
    @ApiModelProperty(value = "库存类型 1库存 2非库存")
    private Integer type;
manage/src/main/resources/mapping/TLensGoods.xml
@@ -5,7 +5,9 @@
    <select id="lensReceiptList" resultType="com.jilongda.manage.vo.TLensGoodsVO">
        select t1.*,t2.name as series,t4.name as store,
        t2.sale as sale,t2.cost as cost,t6.name as brand,t7.frameThreshold
        t2.sphere as sphere,t2.asphericSurface as asphericSurface
        ,t2.doubleNon as doubleNon
             ,t6.name as brand,t7.frameThreshold
        from
        t_lens_goods t1
        left join t_lens_series t2 on t1.seriesId=t2.id