|
@@ -15,11 +15,16 @@ import com.github.zuihou.business.order.entity.Order;
|
|
import com.github.zuihou.business.order.service.OrderService;
|
|
import com.github.zuihou.business.order.service.OrderService;
|
|
import com.github.zuihou.business.productConfig.entity.ProductConfig;
|
|
import com.github.zuihou.business.productConfig.entity.ProductConfig;
|
|
import com.github.zuihou.business.productConfig.service.ProductConfigService;
|
|
import com.github.zuihou.business.productConfig.service.ProductConfigService;
|
|
|
|
+import com.github.zuihou.business.productionresource.entity.ProductionResource;
|
|
|
|
+import com.github.zuihou.business.productionresource.service.ProductionTenantResourceService;
|
|
import com.github.zuihou.business.spe.entity.Spe;
|
|
import com.github.zuihou.business.spe.entity.Spe;
|
|
import com.github.zuihou.business.spe.service.SpeService;
|
|
import com.github.zuihou.business.spe.service.SpeService;
|
|
|
|
+import com.github.zuihou.business.util.CommonUtil;
|
|
import com.github.zuihou.business.wxpay.CipherDto;
|
|
import com.github.zuihou.business.wxpay.CipherDto;
|
|
import com.github.zuihou.cfg.WxPayCfg;
|
|
import com.github.zuihou.cfg.WxPayCfg;
|
|
import com.github.zuihou.context.BaseContextHandler;
|
|
import com.github.zuihou.context.BaseContextHandler;
|
|
|
|
+import com.github.zuihou.database.mybatis.conditions.Wraps;
|
|
|
|
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
|
|
import com.github.zuihou.utils.WxPayUtil;
|
|
import com.github.zuihou.utils.WxPayUtil;
|
|
import com.wechat.pay.contrib.apache.httpclient.auth.Verifier;
|
|
import com.wechat.pay.contrib.apache.httpclient.auth.Verifier;
|
|
import com.wechat.pay.contrib.apache.httpclient.util.AesUtil;
|
|
import com.wechat.pay.contrib.apache.httpclient.util.AesUtil;
|
|
@@ -47,7 +52,7 @@ import java.util.concurrent.TimeUnit;
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("externalApi")
|
|
@RequestMapping("externalApi")
|
|
-public class ExternalApi {
|
|
|
|
|
|
+public class AndroidApi {
|
|
@Autowired
|
|
@Autowired
|
|
private GoodsService goodsService;
|
|
private GoodsService goodsService;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -76,6 +81,8 @@ public class ExternalApi {
|
|
private EquBarrelService barrelService;
|
|
private EquBarrelService barrelService;
|
|
@Autowired
|
|
@Autowired
|
|
private MiniAppService miniAppService;
|
|
private MiniAppService miniAppService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ProductionTenantResourceService productionTenantResourceService;
|
|
|
|
|
|
|
|
|
|
@ApiOperation("获取商品列表")
|
|
@ApiOperation("获取商品列表")
|
|
@@ -322,22 +329,49 @@ public class ExternalApi {
|
|
UpdateWrapper<Order> updateWrapper = new UpdateWrapper<>();
|
|
UpdateWrapper<Order> updateWrapper = new UpdateWrapper<>();
|
|
updateWrapper.eq("id", orderId).set("order_status", orderStatus);
|
|
updateWrapper.eq("id", orderId).set("order_status", orderStatus);
|
|
boolean update = orderService.update(updateWrapper);
|
|
boolean update = orderService.update(updateWrapper);
|
|
- if(orderStatus=="5"){
|
|
|
|
|
|
+ if (orderStatus == "5") {
|
|
// 生产完成,扣减物料,更新料筒和商品状态
|
|
// 生产完成,扣减物料,更新料筒和商品状态
|
|
|
|
|
|
- barrelService.updateBarrel(speId,equId);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ barrelService.updateBarrel(speId, equId);
|
|
}
|
|
}
|
|
|
|
+ return R.success(update);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取未绑定的设备列表
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/getUnboundEquList")
|
|
|
|
+ public R<List<ProductionResource>> getUnboundEquList() {
|
|
|
|
+ LbqWrapper<ProductionResource> queryWrap = Wraps.lbQ();
|
|
|
|
+ queryWrap.eq(ProductionResource::getIdBound, "0").orderByDesc(ProductionResource::getCreateTime);
|
|
|
|
+ List<Long> orgIds = CommonUtil.getOrgIdsArr();
|
|
|
|
+ if (orgIds.size() > 0) {
|
|
|
|
+ queryWrap.in(ProductionResource::getOrgId, orgIds);
|
|
|
|
+ }
|
|
|
|
+ List<ProductionResource> list = productionTenantResourceService.list(queryWrap);
|
|
|
|
+ return R.success(list);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
- return R.success(update);
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 绑定,解绑,设备
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/boundEqu")
|
|
|
|
+ public R<Boolean> boundEqu(String equId, String isBound) {
|
|
|
|
+ UpdateWrapper<ProductionResource> updateWrapper = new UpdateWrapper<>();
|
|
|
|
+ updateWrapper.set("is_bound", isBound);
|
|
|
|
+ updateWrapper.eq("id", equId);
|
|
|
|
+ boolean update = productionTenantResourceService.update(updateWrapper);
|
|
|
|
+ if (update) {
|
|
|
|
+ return R.success(update, "操作成功");
|
|
|
|
+ }
|
|
|
|
+ return R.fail("操作失败");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
}
|
|
}
|