|
@@ -20,6 +20,7 @@ import com.zfire.jiasm.syncdata.service.AddRepairBusinessService;
|
|
|
import com.zfire.jiasm.syncdata.service.JiasmApi;
|
|
|
import com.zfire.jiasm.syncdata.service.OrderService;
|
|
|
import com.zfire.jiasm.syncdata.service.PublicService;
|
|
|
+import com.zfire.jiasm.syncdata.test;
|
|
|
import com.zfire.jiasm.syncdata.utils.MyBeanUtils;
|
|
|
import com.zfire.jiasm.syncdata.utils.ResponseHelper;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -91,6 +92,10 @@ public class AddRepairBusinessServiceImpl implements AddRepairBusinessService {
|
|
|
JiasmApi jiasmApi;
|
|
|
@Resource
|
|
|
BaseService baseService;
|
|
|
+ @Resource
|
|
|
+ BrandService brandService;
|
|
|
+ @Resource
|
|
|
+ TestService testService;
|
|
|
|
|
|
|
|
|
|
|
@@ -298,7 +303,7 @@ public class AddRepairBusinessServiceImpl implements AddRepairBusinessService {
|
|
|
|
|
|
// 工单主表、机型、辅材、清洗、预约改约记录、师傅、创建日志、生成采集数据不要
|
|
|
getOrderApi(item, addmx, order, orderWorker, or, orderApi, orderProductList, orderMaterialList, orderCleanItems,flag);
|
|
|
- log.info("修改维修工单 request:{}", JSONObject.toJSONString(order));
|
|
|
+ log.info("修改维修工单 request:{}", JSONObject.toJSONString(orderApi));
|
|
|
ResponseHelper respone = jiasmApi.orderAdd(orderApi);
|
|
|
log.info("修改维修工单 respone:{}", JSONObject.toJSONString(respone));
|
|
|
if (respone.getCode()==200){
|
|
@@ -2801,4 +2806,76 @@ public class AddRepairBusinessServiceImpl implements AddRepairBusinessService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ // //////////////////////////////////////////
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public Boolean csfun() throws Exception {
|
|
|
+ List<Brand> addmx = new ArrayList<>();
|
|
|
+ List<Brand> upMxd = new ArrayList<>();
|
|
|
+ List<Test> ttt = new ArrayList<>();
|
|
|
+ // 取数据
|
|
|
+ csfuna(upMxd,ttt);
|
|
|
+ // 表中插入数据
|
|
|
+ csfunb(addmx,upMxd,ttt);
|
|
|
+
|
|
|
+ // 网络请求
|
|
|
+ // csfunbc();
|
|
|
+ return Boolean.FALSE;
|
|
|
+ }
|
|
|
+
|
|
|
+ @NotNull
|
|
|
+ public Boolean csfunbc() throws Exception {
|
|
|
+ // 创建工单
|
|
|
+ OrderAddBeanDTO orderApi = new OrderAddBeanDTO();
|
|
|
+
|
|
|
+ ResponseHelper respone = jiasmApi.orderAdd(orderApi);
|
|
|
+ log.info("修改维修工单 respone:{}", JSONObject.toJSONString(respone));
|
|
|
+ if (respone.getCode()==200){
|
|
|
+ return Boolean.TRUE;
|
|
|
+ } else {
|
|
|
+ log.info("网络失败 {}",respone.getMessage());
|
|
|
+ throw new Exception("msg");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private Boolean csfunb(List<Brand> addmx,List<Brand> upMxd,List<Test> ttt){
|
|
|
+ if (upMxd.size()>0){
|
|
|
+ brandService.updateBatchById(upMxd);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ttt.size()>0){
|
|
|
+ testService.saveBatch(ttt);
|
|
|
+ }
|
|
|
+
|
|
|
+ return Boolean.TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void csfuna(List<Brand> upMxd,List<Test> ttt) {
|
|
|
+ List<Brand> mxRec = new ArrayList<>();
|
|
|
+
|
|
|
+ // 提取明细表数据
|
|
|
+ mxRec = brandService.lambdaQuery()
|
|
|
+ .eq(Brand::getBrand, "格力")
|
|
|
+ .list();
|
|
|
+
|
|
|
+ for (Brand rec:mxRec){
|
|
|
+ Brand up = new Brand();
|
|
|
+ up.setBrandId(rec.getBrandId());
|
|
|
+ up.setBrand("格力格");
|
|
|
+ upMxd.add(up);
|
|
|
+ }
|
|
|
+
|
|
|
+ Test t = new Test();
|
|
|
+ t.setId("88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888");
|
|
|
+ ttt.add(t);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // /////////////////////////////////////////////////////////////////////////////
|
|
|
+
|
|
|
}
|