Administrator
2023-04-17 63fbfddabe08e353ad75e495c2ac8dc5203da88c
明晟、义瑞装车
已修改6个文件
已删除1个文件
250 ■■■■■ 文件已修改
JavaSource/com/mandi/fendan/mapper/Fd_XSTDMXMapper.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JavaSource/com/mandi/fendan/util/Contants.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
JavaSource/com/mandi/fendan/util/Contants_production.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JavaSource/com/mandi/webservice/service/IFdXSTDService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JavaSource/com/mandi/webservice/service/IInvoiceService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JavaSource/com/mandi/webservice/service/impl/FdXSTDService.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JavaSource/com/mandi/webservice/service/impl/InvoiceService.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JavaSource/com/mandi/fendan/mapper/Fd_XSTDMXMapper.java
@@ -157,11 +157,24 @@
    @Update("update fd_xstdmx set tdmx_ggxh=#{tdmx_ggxh} where tdmx_tdfl=#{tdmx_tdfl}")
    public int updateMXGG(Fd_XSTDMX mx);
    //明晟 LED è£…车
    @Select({"select  hw.name tdmx_hwmc,mx.* from fd_xstdmx mx " ,
            " left join nc_hw hw on mx.tdmx_hwbh=hw.pkid and hw.state=1 " ,
            " join fd_bsheet on bsNo=tdmx_fdywbh and status='在办' where SdepartNo=#{sdepartNo} "
            " join xs_taskmonitor xt on mx.tdmx_fdywbh = xt.businessNo  ",
            " join fd_bsheet on bsNo=tdmx_fdywbh and status='在办' " ,
            " where SdepartNo=#{sdepartNo} and xt.firstgbtime is not null  and xt.lastgbtime is null and zcWc=0"
    })
    public List<Map> getHwList(String sdepartNo);
    // ä¹‰ç‘žLED显示 åºå·  è½¦å·  è£…车区  çŠ¶æ€
    @Select({
            "select  bs.numberplates,businessNo,zcWz,firstzxhtime," ,
            "case WHEN EXISTS ( SELECT * FROM bussinessitems WHERE bussinessNo = x.businessNo ) THEN '在装'" ,
            " when x.firstgbtime is not null then '待装' else '完成' end zcStatus " ,
            " from xs_taskmonitor x" ,
            " join bussinesssheet bs on x.businessNo=bs.bussinessNo" ,
            " where sdepartNo=#{sdepartNo} and x.lastgbtime is  null and zcWc=0"
    })
    public List<Map> yRZcList(String sdepartNo);
}
JavaSource/com/mandi/fendan/util/Contants.java
@@ -40,7 +40,9 @@
    //分单系统推送一卡通测试地址
    public static String yktLocalAdd=  "http://127.0.0.1:8085"; // "http://10.1.1.9:8088";//一卡通外网测试地址
    public final static String msLedServiceAddr= "http://192.168.200.211:8077/APPService.asmx"; // æ˜Žæ™ŸABC区LED
    public static String msLedServiceAddr = "http://192.168.200.211:8077/APPService.asmx"; // æ˜Žæ™ŸABC区LED
    public static String  yr_zcLedUrl = "http://192.168.200.211:8077/APPService.asmx"; // ä¹‰ç‘žLED è£…车 webservice
//    public static String yktLocalAdd="http://125.46.81.106:8088";//一卡通外网测试地址
    //分单回写nc系统测试地址NCfdhx_url
    public static String NCfdhx_url = "http://10.0.13.20:9088/api/Domain/mtcesb/servlet/PubAPIServlet";
JavaSource/com/mandi/fendan/util/Contants_production.java
ÎļþÒÑɾ³ý
JavaSource/com/mandi/webservice/service/IFdXSTDService.java
@@ -84,4 +84,16 @@
     * @throws Exception
     */
    public ObjectResult<Boolean> savewdControl(JsonArray dataArr)throws Exception;
    /**
     * å‘送到明晟LED ABC区
     * @param currPch
     */
    public void sendToMsLed(String currPch);
    /**
     * å‘送到义瑞 LED åŒº
     * @param currPch
     */
    public void sendToYrLed(String currPch);
}
JavaSource/com/mandi/webservice/service/IInvoiceService.java
@@ -79,4 +79,11 @@
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/savewdcontrol")
    public String savewdControl(@Context HttpServletRequest r,@RequestBody String jsonParam);
    // æŽ¥æ”¶ä¸€æ¬¡ç§°é‡ã€äºŒæ¬¡ç§°é‡ data ä¸€æ¬¡ç§°é‡ firstWeighing secondWeighing
    @POST
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/currWeight")
    public String receiveCurrWeight(@Context HttpServletRequest r,@RequestBody String jsonParam);
}
JavaSource/com/mandi/webservice/service/impl/FdXSTDService.java
@@ -9,6 +9,7 @@
import com.mandi.basicconfig.persist.*;
import com.mandi.common.JSONobj;
import com.mandi.common.ParamFileter.BigDecimalfiter;
import com.mandi.common.SpringContext;
import com.mandi.common.Wxhtmethod;
import com.mandi.dao.common.ObjectResult;
import com.mandi.dao.common.PageResult;
@@ -24,6 +25,7 @@
import com.mandi.webservice.service.IFdXSTDService;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -61,6 +63,9 @@
    private FdRepertoryNexusMapper reNxPer;
    private Logger log= Logger.getLogger(FileLoadImpl.class);
    public static Boolean refreshMsLedLock = false;
    public static Boolean refreshYrLedLock = false;
    @Override
    @Transactional(rollbackFor=Exception.class)
@@ -583,7 +588,43 @@
         // æ­¤å¤„异步触发一下明晟发车
        if("06".equals(fdb.getSdepartNo())) {
            final String cph = currPch;
            ThreadPoolUtil.getInstance().execute(()->sendToMsLed(cph));
            ThreadPoolUtil.getInstance().execute(()->{
                try {
                    synchronized (FdXSTDService.refreshMsLedLock) {
                        if (FdXSTDService.refreshMsLedLock) { // ç³»ç»Ÿç¹å¿™
                            return  ;
                        }
                        FdXSTDService.refreshMsLedLock = true;
                    }
                    sendToMsLed(cph);
                } catch (Exception e) {
                    log.error(e);
                } finally {
                    synchronized (FdXSTDService.refreshMsLedLock) {
                        FdXSTDService.refreshMsLedLock = false;
                    }
                }
            });
        }
        if("08".equals(fdb.getSdepartNo())) {
            final String cph = currPch;
            ThreadPoolUtil.getInstance().execute(()->{
                try {
                    synchronized (FdXSTDService.refreshYrLedLock) {
                        if (FdXSTDService.refreshYrLedLock) { // ç³»ç»Ÿç¹å¿™
                            return  ;
                        }
                        FdXSTDService.refreshYrLedLock = true;
                    }
                    sendToYrLed(cph);
                } catch (Exception e) {
                    log.error(e);
                } finally {
                    synchronized (FdXSTDService.refreshYrLedLock) {
                        FdXSTDService.refreshYrLedLock = false;
                    }
                }
            });
        }
        prr.setCode(0);
        prr.setErrmsg("装车操作成功!");
@@ -599,7 +640,9 @@
        //A区  76-86 +  99-1
        //B区  14-33 +  99-2
        //C区  53-67 +  99-3
        log.info("LED-ABC当前扫码批次号:" + currPch);
        List<Map> totalList =  tdmxper.getHwList("06"); // èŽ·å–明晟所有在办业务单的信息
        log.info("LED-ABC获取信息条数:" + totalList.size());
        Map<String,List<Map>> ywbhListMap = new HashMap<>();
        for (Map map : totalList) {
            String ywdw = (String) map.get("tdmx_fdywbh");
@@ -618,7 +661,8 @@
        // åªæœ‰3个区
        String speakTxtFormatStr3 = "车号%s,%s区装货%d件已全部扫描完成,请司机清点货物后去%s区%s区装货。";
        Map speakParam = new HashMap(1);
        for (Map.Entry<String, List<Map>> entry : ywbhListMap.entrySet()) { // éåŽ†æ¯ä¸ªä¸šåŠ¡å•çš„
        for (Map.Entry<String, List<Map>> entry : ywbhListMap.entrySet()) {
            // éåŽ†æ¯ä¸ªä¸šåŠ¡å•çš„
            // å½“前装车A、B、C区
            boolean currA = false,currB = false, currC = false;
            boolean hasZcwc = false; // ä¿è¯å·²ç»å®Œæˆäº†
@@ -670,14 +714,14 @@
                    }
                }
            }
            if (!hasZcwc) continue; //没有装车完成的也跳过
            if (!(currA || currB || currC) && abcMap.get("A") + abcMap.get("B") + abcMap.get("C") ==
            // if (!hasZcwc) continue; //没有装车完成的也跳过
            /*if (!(currA || currB || currC) && abcMap.get("A") + abcMap.get("B") + abcMap.get("C") ==
                    totalAbcMap.get("A") + totalAbcMap.get("B") + totalAbcMap.get("C")) { // éžå½“前车牌号,已经装车完成但是未出厂
                continue;
            }
            str2 += String.format(formatStr, cph, fillSpace(abcMap.get("A")), fillSpace(totalAbcMap.get("A")),
                    fillSpace(abcMap.get("B")), fillSpace(totalAbcMap.get("B")),
                    fillSpace(abcMap.get("C")), fillSpace(totalAbcMap.get("C")));
            }*/
            str2 += String.format(formatStr, cph, fillWithZero(abcMap.get("A")), fillWithZero(totalAbcMap.get("A")),
                    fillWithZero(abcMap.get("B")), fillWithZero(totalAbcMap.get("B")),
                    fillWithZero(abcMap.get("C")), fillWithZero(totalAbcMap.get("C")));
            // å¼€å§‹å‡†å¤‡è¯­éŸ³
            int total = 0;
            if(currA && abcMap.get("A") == totalAbcMap.get("A")) { // å½“前车在A区装车完成
@@ -748,18 +792,51 @@
            }
            // å•è¾†è½¦çš„单个业务单的信息结束
        }
        if(StringUtils.isBlank(str2)) {
            str2 = "无车辆";
        }
        Map paramMap = new HashMap();
        paramMap.put("strTitle",str1);
        paramMap.put("strContent",str2);
        try {
            log.info("LED-ABC webServiceAddrss:"+Contants.msLedServiceAddr+"st1::" +str1+";;;;;str2::"+str2);
          String re = Wxhtmethod.post(Contants.msLedServiceAddr + "/SendLED",paramMap);
            log.info("LED-ABC result:"+re);
          // è¯­éŸ³åªæ’­ä¸€æ¡
          String re1 = Wxhtmethod.post(Contants.msLedServiceAddr + "/Speak",speakParam);
        }catch (Exception e){}
    }
    String fillSpace(int str){
    @Override
    public void sendToYrLed(String currPch) {
            // çŠ¶æ€ ä¸€ç£…后,待装;PDA扫码 åœ¨è£…ï¼› äºŒæ¬¡è¿‡ç£…后消失
            // è£…车区 ä¸¤ä¸ªæ±‰å­—加两个英文或数字
            String strTitle="序号   è½¦å·   è£…车区   çŠ¶æ€\r\n";
            String strContent = "";
            String contentFormatStr = "%s   %s  %s   %s\r\n";
            List<Map> list = tdmxper.yRZcList("08");
            int index = 1;
            for (Map map : list) {
                String numberplates = (String) map.get("numberplates"); // è½¦ç‰Œå·
                String zcWz = (String) map.get("zcWz"); // è£…车位置
                if(StringUtils.isNotBlank(zcWz)){
                    zcWz = zcWz.substring(0,4);
                } else {
                    zcWz = "    ";
                }
                String zcStatus = (String) map.get("zcStatus"); // è£…车位置 åœ¨åŠž/待办
                strContent += String.format(contentFormatStr, fillWithZero(index++), numberplates, zcWz, zcStatus);
            }
            Map paramMap = new HashMap();
            paramMap.put("strTitle",strTitle);
            paramMap.put("strContent",strContent);
            Wxhtmethod.post(Contants.yr_zcLedUrl + "/SendLED",paramMap);
            log.info("yr_zcLedUrl: " + Contants.yr_zcLedUrl + ";title:" + strTitle + ",content:" + strContent);
    }
    String fillWithZero(int str){
        String s;
        if(str<10 && str>=0) s= "0" + str;
        else s=String.valueOf(str);
JavaSource/com/mandi/webservice/service/impl/InvoiceService.java
@@ -368,5 +368,56 @@
        return str;
    }
    @Override
    public String receiveCurrWeight(HttpServletRequest r, String jsonParam) { // èŽ·å–业务单号 ä¸€æ¬¡ç§°é‡ äºŒæ¬¡ç§°é‡
        JsonParser jp=new JsonParser();
        JsonObject jo=jp.parse(jsonParam).getAsJsonObject();
        String businessNo = JSONobj.getstring(jo, "businessNo");
        boolean firstWeighing = JSONobj.getbool(jo, "firstWeighing");
        boolean secondWeighing = JSONobj.getbool(jo, "secondWeighing");
        String sdepartNo = JSONobj.getstring(jo, "sdepartNo");
        if(StringUtils.isBlank(businessNo) || businessNo.indexOf("XS")!=0 || StringUtils.isBlank(sdepartNo)
        ) {
            return null;
        }
        // åˆ·æ–°
        if(firstWeighing || secondWeighing) { // ç§°é‡éœ€è¦åˆ·æ–°ä¸€ä¸‹
            if ("06".equals(sdepartNo)) { // æ˜Žæ™Ÿ
                synchronized (FdXSTDService.refreshMsLedLock) {
                    if (FdXSTDService.refreshMsLedLock) { // ç³»ç»Ÿç¹å¿™
                        return null;
                    }
                }
                try {
                    synchronized (FdXSTDService.refreshMsLedLock) {
                        FdXSTDService.refreshMsLedLock = true;
                    }
                    fdser.sendToMsLed(null);
                } finally {
                    synchronized (FdXSTDService.refreshMsLedLock) {
                        FdXSTDService.refreshMsLedLock = false;
                    }
                }
            }else if ("08".equals(sdepartNo)) { // ä¹‰ç‘ž
                synchronized (FdXSTDService.refreshYrLedLock) {
                    if (FdXSTDService.refreshYrLedLock) { // ç³»ç»Ÿç¹å¿™
                        return null;
                    }
                }
                try {
                    synchronized (FdXSTDService.refreshYrLedLock) {
                        FdXSTDService.refreshYrLedLock = true;
                    }
                    fdser.sendToYrLed(null);
                }finally {
                    synchronized (FdXSTDService.refreshYrLedLock) {
                        FdXSTDService.refreshYrLedLock = false;
                    }
                }
            }
        }
        return null;
    }
}