Commit 09dc9c2f by 黄森林

app开发

parent 16eab68a
......@@ -19,7 +19,7 @@ import java.util.Map;
*/
@Mapper
@Component
public interface PackageUpgradeMapper extends BaseMapper<PackageUpgrade> {
public interface AppMapper extends BaseMapper<PackageUpgrade> {
@Select("<script>SELECT * FROM `hhr_xyzx_yd_yrym_list` <where> ${ew.sqlSegment} </where> </script>")
List<Map<String,Object>> selectPackage(@Param("ew") Wrapper<PackageUpgrade> wrapper);
......@@ -43,4 +43,5 @@ public interface PackageUpgradeMapper extends BaseMapper<PackageUpgrade> {
List<String> selectPackageId(String schoolId);
}
......@@ -66,6 +66,11 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>com.winsun.gdtel.gztel</groupId>
<artifactId>common</artifactId>
<version>${service.version}</version>
</dependency>
<dependency>
<groupId>com.winsun.framework</groupId>
......
......@@ -29,6 +29,6 @@ public class TaskServiceApplication {
public static void main(String[] args) {
SpringApplication.run(TaskServiceApplication.class, args);
logger.info("集约平台定时任务模块启动成功!!!");
logger.info("定时任务模块启动成功!!!");
}
}
package com.winsun.TimingTask;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.winsun.bean.Order;
import com.winsun.mapper.*;
import com.winsun.utils.MyBatisPlusUpdateUtils;
import com.winsun.utils.XbkUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import java.text.ParseException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Slf4j
@RestController
@Configuration
@EnableScheduling
public class OrderTask {
private static OrderMapper orderMapper;
@Autowired
public OrderTask(OrderMapper orderMapper) {
OrderTask.orderMapper = orderMapper;
}
@Scheduled(cron = "0/5 * * * * ? ")
//@Scheduled(fixedRate=1000*60)
@PostMapping("/orderTask")
public void general() throws ParseException {
Wrapper<Order> wrapper = new EntityWrapper();
wrapper.eq("order_status", "待识别1");
List<Order> orders = orderMapper.selectList(wrapper);
orders.forEach(order -> {
try {
JSONObject jsonObject = XbkUtil.orderInfoJT0006(order.getXbOrderId());
String dataArray = jsonObject.getString("dataArray");
Map<String,Object> Map = JSON.parseObject(dataArray, HashMap.class);
if(Map.get("orderStatus").toString().equals("3") || Map.get("orderStatus").toString().equals("13") ||
Map.get("orderStatus").toString().equals("8") || Map.get("orderStatus").toString().equals("22") ||
Map.get("orderStatus").toString().equals("21") ){
Wrapper<Order> wrapper1 = new EntityWrapper();
wrapper1.eq("xb_order_id",Map.get("orderCode"));
wrapper1.eq("id",order.getId());
Map<String, Object> dataMapping = new HashMap<>();
dataMapping.put("order_status", "待处理");
orderMapper.updateForSet(MyBatisPlusUpdateUtils.toUpdateSet(dataMapping), wrapper1);
}
} catch (Exception e) {
log.info(order.getXbOrderId()+"订单更新失败",e.getMessage());
}
});
/* Wrapper<Order> wrapper2 = new EntityWrapper();
wrapper2.eq("order_status", "待活体");
List<Order> orders1 = orderMapper.selectList(wrapper);
orders1.forEach(order -> {
try {
JSONObject jsonObject = XbkUtil.orderInfoJT0006(order.getXbOrderId());
String dataArray = jsonObject.getString("dataArray");
Map<String,Object> Map = JSON.parseObject(dataArray, HashMap.class);
if(Map.get("orderStatus").toString().equals("3") || Map.get("orderStatus").toString().equals("13")){
Wrapper<Order> wrapper1 = new EntityWrapper();
wrapper1.eq("xb_order_id",Map.get("orderCode"));
wrapper1.eq("id",order.getId());
Map<String, Object> dataMapping = new HashMap<>();
dataMapping.put("order_status", "已完成");
orderMapper.updateForSet(MyBatisPlusUpdateUtils.toUpdateSet(dataMapping), wrapper1);
}
} catch (Exception e) {
log.info(order.getXbOrderId()+"订单更新失败",e.getMessage());
}
});*/
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment