小票打印bug修复
This commit is contained in:
@@ -106,7 +106,7 @@ public abstract class PrinterHandler {
|
||||
if (isTemporary == 0 && sku == null) {
|
||||
log.error("商品不存在, id: {}", item.getProductSkuId());
|
||||
return;
|
||||
} else {
|
||||
} else if(isTemporary == 1){
|
||||
sku = new TbProductSkuWithBLOBs();
|
||||
}
|
||||
if (StrUtil.isEmpty(machine.getClassifyPrint())) {
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
@@ -375,44 +376,26 @@ public class PrinterUtils {
|
||||
|
||||
Map<String, String> param = getToken(time, uuid);
|
||||
//参数
|
||||
//MultiValueMap<String, Object> multiValueMap = new LinkedMultiValueMap<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("token", param.get("TOKEN"));
|
||||
map.put("devName", devName);
|
||||
map.put("money", null);
|
||||
map.put("content", "收款100元");
|
||||
map.put("broadCastType", "1");
|
||||
//multiValueMap.put("actWay", actWay);
|
||||
//multiValueMap.put("cn", cn);
|
||||
//multiValueMap.put("data", data);
|
||||
//multiValueMap.put("voiceJson", voiceJson);
|
||||
map.put("appId", APP_ID);
|
||||
map.put("timestamp", time);
|
||||
map.put("requestId", uuid);
|
||||
map.put("userCode", USER_CODE);
|
||||
map.put("bizType", "2");
|
||||
MultiValueMap<String, Object> multiValueMap = new LinkedMultiValueMap<>();
|
||||
multiValueMap.add("token", param.get("TOKEN"));
|
||||
multiValueMap.add("devName", devName);
|
||||
multiValueMap.add("actWay", actWay);
|
||||
multiValueMap.add("cn", cn);
|
||||
multiValueMap.add("data", data);
|
||||
multiValueMap.add("voiceJson", voiceJson);
|
||||
multiValueMap.add("appId", APP_ID);
|
||||
multiValueMap.add("timestamp", time);
|
||||
multiValueMap.add("requestId", uuid);
|
||||
multiValueMap.add("userCode", USER_CODE);
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
HttpHeaders header = new HttpHeaders();
|
||||
header.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
||||
|
||||
String s = HttpUtil.get("https://ioe.car900.com/v1/openApi/dev/controlDevice.json", map, 50000);
|
||||
System.out.println(s);
|
||||
HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity<>(multiValueMap, header);
|
||||
String httpResponse = restTemplate.postForObject(URL_STR,
|
||||
httpEntity, String.class);
|
||||
|
||||
HttpEntity<MultiValueMap<String, Object>> httpEntity = null;
|
||||
String httpResponse;
|
||||
try {
|
||||
httpResponse = restTemplate.getForObject("https://ioe.car900.com/v1/openApi/dev/registerCloud.json",
|
||||
String.class);
|
||||
System.out.println("map" + httpResponse);
|
||||
return httpResponse;
|
||||
} catch (Exception e) {
|
||||
if (StrUtil.containsAny(e.getMessage(), "timed out")) {
|
||||
log.error("请求云享印超时,请稍后再试");
|
||||
httpResponse = "{\"code\":-1, \"msg\":\"请求云享印超时,请稍后再试\"}";
|
||||
} else {
|
||||
httpResponse = "{\"code\":-2, \"msg\":\"请求云享印出错,请稍后再试\"}";
|
||||
}
|
||||
}
|
||||
System.out.println("map" + httpResponse);
|
||||
return httpResponse;
|
||||
}
|
||||
|
||||
|
||||
@@ -543,11 +543,13 @@
|
||||
group by shop_id,product_id
|
||||
</select>
|
||||
|
||||
<!--
|
||||
<update id="updateStockById">
|
||||
update tb_product
|
||||
set stock_number = stock_number - #{num,jdbcType=INTEGER}
|
||||
where id = #{productId}
|
||||
</update>
|
||||
-->
|
||||
|
||||
<select id="selectBySkuId" resultType="com.chaozhanggui.system.cashierservice.entity.po.ProConsSkuInfo">
|
||||
SELECT
|
||||
|
||||
Reference in New Issue
Block a user