This commit is contained in:
sxu 2023-12-08 13:07:45 +08:00
parent a928c49d3c
commit 2c90a0063c
4 changed files with 49 additions and 14 deletions

View File

@ -56,4 +56,14 @@ public enum BusinessType
* 清空数据 * 清空数据
*/ */
CLEAN, CLEAN,
/**
* 同意批准
*/
APPROVE,
/**
* 驳回拒绝
*/
REJECT,
} }

View File

@ -16,6 +16,7 @@ import com.bonus.zlpt.order.feign.EquipClient;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
@ -40,6 +41,8 @@ import static com.bonus.zlpt.common.core.web.domain.AjaxResult.DATA_TAG;
@RequestMapping("/info") @RequestMapping("/info")
public class OrderInfoController extends BaseController public class OrderInfoController extends BaseController
{ {
private final String REJECT_ORDER_STATUS = "39";
@Autowired @Autowired
private IOrderInfoService orderInfoService; private IOrderInfoService orderInfoService;
@Autowired @Autowired
@ -55,18 +58,20 @@ public class OrderInfoController extends BaseController
{ {
startPage(); startPage();
List<OrderInfoVo> list = orderInfoService.selectOrderInfoList(orderInfo); List<OrderInfoVo> list = orderInfoService.selectOrderInfoList(orderInfo);
for (OrderInfoVo orderInfoVo : list) { if (!CollectionUtils.isEmpty(list)) {
Map map1 = (Map) equipClient.getInfo(orderInfoVo.getMaId()); for (OrderInfoVo orderInfoVo : list) {
if (map1 != null) { Map map1 = (Map) equipClient.getInfo(orderInfoVo.getMaId());
Map map2 = (Map) map1.get(DATA_TAG); if (map1 != null) {
if (map2 != null) { Map map2 = (Map) map1.get(DATA_TAG);
String typeName = (String) map2.get("typeName"); if (map2 != null) {
String groupName = (String) map2.get("groupName"); String typeName = (String) map2.get("typeName");
String modelName = (String) map2.get("modelName"); String groupName = (String) map2.get("groupName");
String deviceName = (String) map2.get("deviceName"); String modelName = (String) map2.get("modelName");
orderInfoVo.setTypeName(typeName); String deviceName = (String) map2.get("deviceName");
orderInfoVo.setGroupName(groupName); orderInfoVo.setTypeName(typeName);
orderInfoVo.setDeviceName(modelName + deviceName); orderInfoVo.setGroupName(groupName);
orderInfoVo.setDeviceName(modelName + deviceName);
}
} }
} }
} }
@ -136,6 +141,19 @@ public class OrderInfoController extends BaseController
return toAjax(orderInfoService.updateOrderInfo(orderInfo)); return toAjax(orderInfoService.updateOrderInfo(orderInfo));
} }
/**
* 驳回订单
*/
@ApiOperation(value = "驳回订单")
@RequiresPermissions("order:info:edit")
@Log(title = "订单信息", businessType = BusinessType.REJECT)
@PutMapping(value = "/reject")
public AjaxResult reject(@RequestBody OrderInfoVo orderInfo)
{
orderInfo.setOrderStatus(REJECT_ORDER_STATUS);
return toAjax(orderInfoService.rejectOrderInfo(orderInfo));
}
/** /**
* 删除订单信息 * 删除订单信息
*/ */

View File

@ -44,6 +44,8 @@ public interface IOrderInfoService
*/ */
public int updateOrderInfo(OrderInfoVo orderInfo); public int updateOrderInfo(OrderInfoVo orderInfo);
public int rejectOrderInfo(OrderInfoVo orderInfo);
/** /**
* 批量删除订单信息 * 批量删除订单信息
* *

View File

@ -90,8 +90,13 @@ public class OrderInfoServiceImpl implements IOrderInfoService
orderDetailsMapper.insertAttachment(fileInfoDto); orderDetailsMapper.insertAttachment(fileInfoDto);
} }
orderInfoMapper.updateOrderDetails(orderInfo); orderInfoMapper.updateOrderDetails(orderInfo);
LoginUser user = SecurityUtils.getLoginUser(); // LoginUser user = SecurityUtils.getLoginUser();
orderInfo.setOrderUser(user.getUserid()); return orderInfoMapper.updateOrderInfo(orderInfo);
}
@Override
public int rejectOrderInfo(OrderInfoVo orderInfo)
{
return orderInfoMapper.updateOrderInfo(orderInfo); return orderInfoMapper.updateOrderInfo(orderInfo);
} }