JavaSource/com/mandi/fendan/mapper/Fd_XSTDMXMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
JavaSource/com/mandi/fendan/util/Contants.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
JavaSource/com/mandi/fendan/util/Contants_production.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
JavaSource/com/mandi/webservice/service/IFdXSTDService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
JavaSource/com/mandi/webservice/service/IInvoiceService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
JavaSource/com/mandi/webservice/service/impl/FdXSTDService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
JavaSource/com/mandi/webservice/service/impl/InvoiceService.java | ●●●●● 补丁 | 查看 | 原始文档 | 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
@@ -39,8 +39,10 @@ //ååç³»ç»æ¨éä¸å¡éæµè¯å°å 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 yktLocalAdd = "http://127.0.0.1:8085"; // "http://10.1.1.9:8088";//ä¸å¡éå¤ç½æµè¯å°å 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 { String re = Wxhtmethod.post(Contants.msLedServiceAddr + "/SendLED",paramMap); // è¯é³åªæä¸æ¡ String re1 = Wxhtmethod.post(Contants.msLedServiceAddr + "/Speak",speakParam); 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; } }