hjg
10 小时以前 f1b726d853f242c5558239138defcd5d0b1636df
erp分单
已修改2个文件
49 ■■■■■ 文件已修改
JavaSource/com/mandi/fendan/mapper/xmls/Fd_XSTDMapper.xml 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JavaSource/com/mandi/fendan/service/impl/ErpService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JavaSource/com/mandi/fendan/mapper/xmls/Fd_XSTDMapper.xml
@@ -5,7 +5,7 @@
    a.td_bmbh,a.td_bmmc,a.td_bz,a.td_djrq,a.td_fpbh, a.td_jylx, a.td_khbh,a.td_cqNo,a.committime,
    CASE WHEN a.td_fpbh IS NULL THEN b.name WHEN a.td_fpbh= '' THEN b.name
<!--    WHEN a.td_ywdybh= '101' THEN '河南报关'  WHEN a.td_ywdybh= '102' THEN '郑州报关' WHEN a.td_ywdybh= '111' THEN '明晟报关' WHEN a.td_ywdybh= '114' THEN '义瑞报关' ELSE '科技报关'-->
    WHEN a.td_cqNo= '101' THEN '河南报关'  WHEN a.td_ywdybh= '102' THEN '郑州报关' WHEN a.td_ywdybh= '111' THEN '明晟报关' WHEN a.td_ywdybh= '114' THEN '义瑞报关' ELSE '科技报关'
    WHEN a.td_cqNo= '101' THEN '河南报关'  WHEN a.td_cqNo= '102' THEN '郑州报关' WHEN a.td_cqNo= '111' THEN '明晟报关' WHEN a.td_cqNo= '114' THEN '义瑞报关' ELSE '科技报关'
    END td_khmc,
    a.td_shddbh,
    c.name as td_shdd,
@@ -25,8 +25,10 @@
    <!--查询地区的厂区 -->
    <sql id="sqlDq">
        ISNULL((select STUFF((select distinct ','+b.name from fd_wlgs_fhdq f left join fd_company b on f.wlgsNo=b.companyNo where f.fhdqNo=a.td_shddbh
        and f.ywdyNo=(case when a.td_ywdybh in ('102','111','114')  then a.td_ywdybh  else '103' end)
             and EXISTS (SELECT 1 from fd_company_ywdy c where b.companyNo=c.companyNo and c.ywdyNo=a.td_ywdybh )
<!--        and f.ywdyNo=(case when a.td_ywdybh in ('102','111','114')  then a.td_ywdybh  else '103' end)-->
        and f.ywdyNo=(case when a.td_cqNo in ('102','111','114')  then a.td_cqNo  else '103' end)
<!--             and EXISTS (SELECT 1 from fd_company_ywdy c where b.companyNo=c.companyNo and c.ywdyNo=a.td_ywdybh )-->
<!--             and EXISTS (SELECT 1 from fd_company_ywdy c where b.companyNo=c.companyNo and c.ywdyNo=a.td_cqNo )-->  <!--不再考虑分单业务单元-->
              for xml path('')
        ),1,1,'' ) ),'')
    </sql>
@@ -41,7 +43,7 @@
    <!-- 根据地区来决定是否显示 -->
    <sql id="changqu">
        <if test=" cqV !=null and cqV !='' ">
<!--        <if test=" cqV !=null and cqV !='' ">-->
            <if test="companyNo!=null and companyNo!=''">  <!--要确保是管理员或者是fdAdmin的时候companyNo是空-->
                and ( (a.td_ztbz not in (1,3) and EXISTS ( select * from fd_company_ywdy cy left join fd_company fc on
                cy.companyNo = fc.companyNo where hasSPR=1 and cy.companyNo=#{companyNo} ) )   <!-- 拥有自提权限的只能看到厂区范围的 -->
@@ -61,15 +63,16 @@
                ) )
                )
            </if>
            <choose>
                <when test="cqV=='102' || cqV=='111' || cqV=='114'">
                    and a.td_cqNo=#{cqV}
                </when>
                <otherwise>
                    and a.td_cqNo !='102' and a.td_cqNo !='111' and a.td_cqNo !='114'
                </otherwise>
            </choose>
        </if>
            <if test=" cqV !=null and cqV !='' ">
                <choose>
                    <when test="cqV=='102' || cqV=='111' || cqV=='114'">
                        and a.td_cqNo=#{cqV}
                    </when>
                    <otherwise>
                        and a.td_cqNo !='102' and a.td_cqNo !='111' and a.td_cqNo !='114'
                    </otherwise>
                </choose>
            </if>
    </sql>
   <sql id="condition">
       <if test="companyNo !=null and companyNo !='' ">
@@ -125,7 +128,7 @@
           and ( a.td_zdr like '%'+#{zdr}+'%')
       </if>
       <!-- 关联流水号中的可见物流公司(全部为空,显示地区;不全部为空,显示地区+可见;全部不为空,显示可见物流公司) -->
       <if test=" cqV !=null and cqV !='' ">
<!--       <if test=" cqV !=null and cqV !='' ">-->
          and case when not exists (select * from fd_mx_wlgs where td_tdls=a.td_tdls)
           <include refid="changqu"/> <!--  厂区可见 -->
           then 1
@@ -137,7 +140,7 @@
               or exists(select * from fd_mx_wlgs where td_tdls=a.td_tdls and wlgs_no=#{companyNo}) then 1
           </if>
           else 0 end > 0
       </if>
<!--       </if>-->
   </sql>
JavaSource/com/mandi/fendan/service/impl/ErpService.java
@@ -283,7 +283,7 @@
        }
        // 如果是管理员或者非提单更物流公司的操作
        boolean isAdminOrFdAdmin = UserType.admin.toString().equals(lg.getWorkerno())  || StringUtils.isNotBlank(fdAdmin);
        if (StringUtils.isEmpty(companyNo)) {
         if (StringUtils.isEmpty(companyNo)) {
            if (!isAdminOrFdAdmin) { // 如果不是更改车辆分单管理员和也不是系统管理员,需要加上公司no
                companyNo = lg.getDepartno();
            }
@@ -569,7 +569,8 @@
                        /*xstd.getTd_ywdybh().equals(Contants.nc_ywdy_ZZ) ? Contants.nc_ywdy_ZZ:
                                xstd.getTd_ywdybh().equals(Contants.nc_ywdy_MS) ? Contants.nc_ywdy_MS
                                : Contants.nc_ywdy_KJ*/
                        ConvertTool.ncGetDefault(xstd.getTd_ywdybh())
//                        ConvertTool.ncGetDefault(xstd.getTd_ywdybh())
                        ConvertTool.ncGetDefault(xstd.getTd_cqNo())
                );
                // 这个地方改一下,允许fd_mx_wlgs中存在的单查看
                int total = fdMxWlgsMapper.selectCountByTdTdls(xstd.getTd_tdls());
@@ -655,7 +656,8 @@
                        /*xstd.getTd_ywdybh().equals(Contants.nc_ywdy_ZZ) ? Contants.nc_ywdy_ZZ:
                                xstd.getTd_ywdybh().equals(Contants.nc_ywdy_MS) ? Contants.nc_ywdy_MS
                                : Contants.nc_ywdy_KJ*/
                        ConvertTool.ncGetDefault(xstd.getTd_ywdybh())
//                        ConvertTool.ncGetDefault(xstd.getTd_ywdybh())
                        ConvertTool.ncGetDefault(xstd.getTd_cqNo())
                );
                int total = fdMxWlgsMapper.selectCountByTdTdls(xstd.getTd_tdls());
                if (ccr == null && total == 0) {
@@ -1147,7 +1149,8 @@
                            return orr;
                        }
                    } else {
                        Rcompany = ConvertTool.covertToCustoms(td.getTd_ywdybh());
//                        Rcompany = ConvertTool.covertToCustoms(td.getTd_ywdybh());
                        Rcompany = ConvertTool.covertToCustoms(td.getTd_cqNo());
                    }
                }
                tdl.add(td);
@@ -1695,10 +1698,11 @@
                    /*td.getTd_ywdybh().equals(Contants.nc_ywdy_ZZ) ? Contants.nc_ywdy_ZZ
                            :td.getTd_ywdybh().equals(Contants.nc_ywdy_MS) ? Contants.nc_ywdy_MS
                            : Contants.nc_ywdy_KJ*/
                    ConvertTool.ncGetDefault(td.getTd_ywdybh())
//                    ConvertTool.ncGetDefault(td.getTd_ywdybh())
                    ConvertTool.ncGetDefault(td.getTd_cqNo())
            );
            int total = fdMxWlgsMapper.selectCountByTdTdls(td.getTd_tdls());
            int total = fdMxWlgsMapper.selectCountByTdTdls(td.getTd_cqNo());
            if (wldq == null && total == 0) {
                orr.setCode(1);
                orr.setErrmsg("当前账号所属物流公司没有配置该地区的分单权限!");