|
|
@@ -13,6 +13,8 @@ import com.uas.eis.service.ScheduleTaskService;
|
|
|
import com.uas.eis.utils.MD5Util;
|
|
|
import com.uas.eis.utils.PSHttpUtils;
|
|
|
import com.uas.eis.utils.StringUtil;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -27,6 +29,7 @@ import java.util.Map;
|
|
|
*/
|
|
|
@Service
|
|
|
public class ScheduleTaskServiceImpl implements ScheduleTaskService {
|
|
|
+ private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
private static Map<String,String> tokenConfig = TokenProperties.getAllProperty();
|
|
|
|
|
|
@Autowired
|
|
|
@@ -133,16 +136,18 @@ public class ScheduleTaskServiceImpl implements ScheduleTaskService {
|
|
|
private Map<String, Object> syncMES(String params,String url){
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("code",-1);
|
|
|
- System.err.println(params);
|
|
|
+ logger.info("params=="+params);
|
|
|
try {
|
|
|
String post = PSHttpUtils.sendPost(tokenConfig.get("mesHttp") + url, params);
|
|
|
JSONObject jsonObject = JSON.parseObject(post);
|
|
|
int code = jsonObject.getIntValue("result");
|
|
|
+ logger.info("code=="+code);
|
|
|
if (code==0){
|
|
|
map.put("code",code);
|
|
|
map.put("msg","同步MES成功");
|
|
|
}else if(code==1){
|
|
|
map.put("code",code);
|
|
|
+ logger.info("msg=="+jsonObject.getString("message"));
|
|
|
map.put("msg",jsonObject.getString("message"));
|
|
|
}else {
|
|
|
map.put("code",-1);
|