|
@ -0,0 +1,117 @@
|
|
|
|
package com.yihu.jw.base.endpoint.open.nologin;
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.yihu.jw.base.service.a3service.MedicineOrderService;
|
|
|
|
import com.yihu.jw.base.service.advrtisement.AdvertisementLaunchService;
|
|
|
|
import com.yihu.jw.base.util.ConstantUtils;
|
|
|
|
import com.yihu.jw.entity.a1entity.MedicineShipmentLog;
|
|
|
|
import com.yihu.jw.entity.adv.AdvertisementLaunchDO;
|
|
|
|
import com.yihu.jw.entity.adv.AdvertisementPuttingAdminDO;
|
|
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
|
|
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
|
|
|
|
import com.yihu.jw.rm.base.BaseRequestMapping;
|
|
|
|
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
|
|
|
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author zmk
|
|
|
|
* 业务不用登陆访问居民PC端控制类
|
|
|
|
* Created at 2019/12/25。
|
|
|
|
*/
|
|
|
|
@RestController
|
|
|
|
@RequestMapping(value = "/open/noLogin")
|
|
|
|
@Api(value = "业务不用登陆访问居民PC端控制类", description = "业务不用登陆访问居民PC端控制类")
|
|
|
|
public class ServiceNoLoginEndPoint extends EnvelopRestEndpoint {
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
AdvertisementLaunchService launchService;
|
|
|
|
@Autowired
|
|
|
|
private MedicineOrderService orderservice;
|
|
|
|
|
|
|
|
@GetMapping(value = "/devinfo")
|
|
|
|
@ApiOperation(value = "获取单个设备上的所有广告")
|
|
|
|
public Envelop solo(
|
|
|
|
@ApiParam(name = "machineCode",value = "设备编码",required = true)
|
|
|
|
@RequestParam(value = "machineCode",required = true)String machineCode){
|
|
|
|
List<AdvertisementPuttingAdminDO> list=launchService.solo(machineCode);
|
|
|
|
if (null==list){
|
|
|
|
return failed("该设备没有广告或者该设备编码不存在");
|
|
|
|
}
|
|
|
|
return success("获取单个设备上所有广告明细成功",list);
|
|
|
|
}
|
|
|
|
|
|
|
|
@GetMapping(value = BaseRequestMapping.BaseOrder.checkOrder)
|
|
|
|
@ApiOperation(value = "检查订单" , notes="检查订单")
|
|
|
|
public Envelop checkOrder(
|
|
|
|
@ApiParam(name = "deviceId", value = "设备id", required = true)
|
|
|
|
@RequestParam(value = "deviceId", required = true) String deviceId,
|
|
|
|
@ApiParam(name = "pickUpNum", value = "取药码")
|
|
|
|
@RequestParam(value = "pickUpNum", required = false) String pickUpNum,
|
|
|
|
@ApiParam(name = "cardNum", value = "社保卡号")
|
|
|
|
@RequestParam(value = "cardNum", required = false) String cardNum
|
|
|
|
) {
|
|
|
|
JSONObject jsonObject = orderservice.checkOrder(deviceId, pickUpNum, cardNum);
|
|
|
|
if (jsonObject.getString("response").equalsIgnoreCase(ConstantUtils.FAIL)) {
|
|
|
|
return failed(jsonObject.getString("msg"));
|
|
|
|
}
|
|
|
|
return success(jsonObject.getJSONObject("msg"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = BaseRequestMapping.BaseOrder.checkOrderAndReturn)
|
|
|
|
@ApiOperation(value = "检查订单并且返回列表" , notes="检查订单")
|
|
|
|
public Envelop checkOrderAndReturn(
|
|
|
|
@ApiParam(name = "deviceId", value = "设备id", required = true)
|
|
|
|
@RequestParam(value = "deviceId", required = true) String deviceId,
|
|
|
|
@ApiParam(name = "pickUpNum", value = "取药码")
|
|
|
|
@RequestParam(value = "pickUpNum", required = false) String pickUpNum,
|
|
|
|
@ApiParam(name = "cardNum", value = "社保卡号")
|
|
|
|
@RequestParam(value = "cardNum", required = false) String cardNum
|
|
|
|
) {
|
|
|
|
JSONObject jsonObject = orderservice.checkOrderAndReturn(deviceId, pickUpNum, cardNum);
|
|
|
|
if (jsonObject.getString("response").equalsIgnoreCase(ConstantUtils.FAIL)) {
|
|
|
|
return failed(jsonObject.getString("msg"));
|
|
|
|
}
|
|
|
|
return success(jsonObject.getJSONObject("msg"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = BaseRequestMapping.BaseOrder.getOrderOutList)
|
|
|
|
@ApiOperation(value = "通过orderId查询订单出货单" , notes="通过orderId查询订单出货单")
|
|
|
|
public Envelop getOrderOutList(
|
|
|
|
@ApiParam(name = "orderId", value = "订单id", required = true)
|
|
|
|
@RequestParam(value = "orderId", required = true) String orderId
|
|
|
|
) throws Exception {
|
|
|
|
JSONObject jsonObject = orderservice.getOrderOutList(orderId);
|
|
|
|
if (jsonObject.getString("response").equalsIgnoreCase(ConstantUtils.FAIL)) {
|
|
|
|
return failed(jsonObject.getString("msg"));
|
|
|
|
}
|
|
|
|
List<MedicineShipmentLog> list = JSONObject.parseArray(jsonObject.getJSONArray("msg").toJSONString(), MedicineShipmentLog.class);
|
|
|
|
return success(list, MedicineShipmentLog.class);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = BaseRequestMapping.BaseOrder.updateOrderOutStatus)
|
|
|
|
@ApiOperation(value = "更新订单出货单状态" , notes="更新订单出货单状态")
|
|
|
|
public Envelop updateOrderOut(
|
|
|
|
@ApiParam(name = "shipmentLogId", value = "订单id", required = true)
|
|
|
|
@RequestParam(value = "shipmentLogId", required = true) String shipmentLogId,
|
|
|
|
@ApiParam(name = "status", value = "目标状态", required = true)
|
|
|
|
@RequestParam(value = "status", required = true) String status
|
|
|
|
) throws Exception {
|
|
|
|
JSONObject jsonObject = orderservice.updateOrderOutStatus(shipmentLogId, status);
|
|
|
|
return success(jsonObject.getString("msg"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|