no message
This commit is contained in:
parent
3fbd432b9c
commit
61e9859181
|
|
@ -165,6 +165,80 @@ public class OrderMasterController extends BaseController {
|
||||||
return toAjax(orderMasterService.updateOrderMaster(orderMaster));
|
return toAjax(orderMasterService.updateOrderMaster(orderMaster));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改订单开票状态
|
||||||
|
*
|
||||||
|
* @param orderMaster 订单对象,包含id和isInvoiced字段
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/changeInvoiceStatus")
|
||||||
|
@ResponseBody
|
||||||
|
@Log(title = "订单开票状态管理", businessType = BusinessType.UPDATE)
|
||||||
|
public AjaxResult changeInvoiceStatus(@RequestBody OrderMaster orderMaster)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
if (orderMaster.getId() == null) {
|
||||||
|
return AjaxResult.error("订单ID不能为空");
|
||||||
|
}
|
||||||
|
if (orderMaster.getIsInvoiced() == null) {
|
||||||
|
return AjaxResult.error("开票状态不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 只更新开票状态字段
|
||||||
|
OrderMaster updateOrder = new OrderMaster();
|
||||||
|
updateOrder.setId(orderMaster.getId());
|
||||||
|
updateOrder.setIsInvoiced(orderMaster.getIsInvoiced());
|
||||||
|
updateOrder.setUpdateBy(getLoginName());
|
||||||
|
|
||||||
|
int result = orderMasterService.updateOrderMaster(updateOrder);
|
||||||
|
if (result > 0) {
|
||||||
|
String statusDesc = orderMaster.getIsInvoiced() == 0 ? "已开票" : "未开票";
|
||||||
|
return AjaxResult.success("订单开票状态已更新为:" + statusDesc);
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error("更新失败,请检查订单是否存在");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("更新失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改订单是否需要开票状态
|
||||||
|
*
|
||||||
|
* @param orderMaster 订单对象,包含id和isNeedBill字段
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/changeNeedBillStatus")
|
||||||
|
@ResponseBody
|
||||||
|
@Log(title = "订单是否需要开票状态管理", businessType = BusinessType.UPDATE)
|
||||||
|
public AjaxResult changeNeedBillStatus(@RequestBody OrderMaster orderMaster)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
if (orderMaster.getId() == null) {
|
||||||
|
return AjaxResult.error("订单ID不能为空");
|
||||||
|
}
|
||||||
|
if (orderMaster.getIsNeedBill() == null) {
|
||||||
|
return AjaxResult.error("是否需要开票状态不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 只更新是否需要开票状态字段
|
||||||
|
OrderMaster updateOrder = new OrderMaster();
|
||||||
|
updateOrder.setId(orderMaster.getId());
|
||||||
|
updateOrder.setIsNeedBill(orderMaster.getIsNeedBill());
|
||||||
|
updateOrder.setUpdateBy(getLoginName());
|
||||||
|
|
||||||
|
int result = orderMasterService.updateOrderMaster(updateOrder);
|
||||||
|
if (result > 0) {
|
||||||
|
String statusDesc = orderMaster.getIsNeedBill() == 1 ? "需要开票" : "不需要开票";
|
||||||
|
return AjaxResult.success("订单是否需要开票状态已更新为:" + statusDesc);
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error("更新失败,请检查订单是否存在");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("更新失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改详细订单
|
* 修改详细订单
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -262,4 +262,16 @@ public class OrderMaster extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
@Excel(name = "是否发货到服务店", cellType = Excel.ColumnType.NUMERIC)
|
@Excel(name = "是否发货到服务店", cellType = Excel.ColumnType.NUMERIC)
|
||||||
private Integer isDeliveryToStore;
|
private Integer isDeliveryToStore;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已开票:0=是,1=否
|
||||||
|
*/
|
||||||
|
@Excel(name = "是否已开票", cellType = Excel.ColumnType.NUMERIC, readConverterExp = "0=是,1=否")
|
||||||
|
private Integer isInvoiced;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否需要开票:0=不需要,1=需要
|
||||||
|
*/
|
||||||
|
@Excel(name = "是否需要开票", cellType = Excel.ColumnType.NUMERIC, readConverterExp = "0=不需要,1=需要")
|
||||||
|
private Integer isNeedBill;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,8 @@
|
||||||
<result property="hasServiceOrder" column="has_service_order"/>
|
<result property="hasServiceOrder" column="has_service_order"/>
|
||||||
<result property="orderImages" column="order_images"/>
|
<result property="orderImages" column="order_images"/>
|
||||||
<result property="isDeliveryToStore" column="is_delivery_to_store"/>
|
<result property="isDeliveryToStore" column="is_delivery_to_store"/>
|
||||||
|
<result property="isInvoiced" column="is_invoiced"/>
|
||||||
|
<result property="isNeedBill" column="is_need_bill"/>
|
||||||
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
@ -113,7 +115,9 @@
|
||||||
server_goods_money,
|
server_goods_money,
|
||||||
has_service_order,
|
has_service_order,
|
||||||
order_images,
|
order_images,
|
||||||
is_delivery_to_store
|
is_delivery_to_store,
|
||||||
|
is_invoiced,
|
||||||
|
is_need_bill
|
||||||
|
|
||||||
FROM order_master
|
FROM order_master
|
||||||
</sql>
|
</sql>
|
||||||
|
|
@ -169,7 +173,9 @@
|
||||||
om.server_goods_money,
|
om.server_goods_money,
|
||||||
om.has_service_order,
|
om.has_service_order,
|
||||||
om.order_images,
|
om.order_images,
|
||||||
om.is_delivery_to_store
|
om.is_delivery_to_store,
|
||||||
|
om.is_invoiced,
|
||||||
|
om.is_need_bill
|
||||||
FROM order_master om
|
FROM order_master om
|
||||||
LEFT JOIN customer_address ca ON ca.customer_address_id = om.address_id
|
LEFT JOIN customer_address ca ON ca.customer_address_id = om.address_id
|
||||||
LEFT JOIN goods g ON g.goods_id = om.goods_id
|
LEFT JOIN goods g ON g.goods_id = om.goods_id
|
||||||
|
|
@ -468,6 +474,8 @@
|
||||||
<if test="hasServiceOrder != null">has_service_order = #{hasServiceOrder},</if>
|
<if test="hasServiceOrder != null">has_service_order = #{hasServiceOrder},</if>
|
||||||
<if test="orderImages != null">order_images = #{orderImages},</if>
|
<if test="orderImages != null">order_images = #{orderImages},</if>
|
||||||
<if test="isDeliveryToStore != null">is_delivery_to_store = #{isDeliveryToStore},</if>
|
<if test="isDeliveryToStore != null">is_delivery_to_store = #{isDeliveryToStore},</if>
|
||||||
|
<if test="isInvoiced != null">is_invoiced = #{isInvoiced},</if>
|
||||||
|
<if test="isNeedBill != null">is_need_bill = #{isNeedBill},</if>
|
||||||
update_time = SYSDATE()
|
update_time = SYSDATE()
|
||||||
</set>
|
</set>
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
|
|
@ -529,6 +537,8 @@
|
||||||
<if test="hasServiceOrder != null">has_service_order,</if>
|
<if test="hasServiceOrder != null">has_service_order,</if>
|
||||||
<if test="orderImages != null">order_images,</if>
|
<if test="orderImages != null">order_images,</if>
|
||||||
<if test="isDeliveryToStore != null">is_delivery_to_store,</if>
|
<if test="isDeliveryToStore != null">is_delivery_to_store,</if>
|
||||||
|
<if test="isInvoiced != null">is_invoiced,</if>
|
||||||
|
<if test="isNeedBill != null">is_need_bill,</if>
|
||||||
create_time
|
create_time
|
||||||
)VALUES(
|
)VALUES(
|
||||||
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
||||||
|
|
@ -571,6 +581,8 @@
|
||||||
<if test="hasServiceOrder != null">#{hasServiceOrder},</if>
|
<if test="hasServiceOrder != null">#{hasServiceOrder},</if>
|
||||||
<if test="orderImages != null">#{orderImages},</if>
|
<if test="orderImages != null">#{orderImages},</if>
|
||||||
<if test="isDeliveryToStore != null">#{isDeliveryToStore},</if>
|
<if test="isDeliveryToStore != null">#{isDeliveryToStore},</if>
|
||||||
|
<if test="isInvoiced != null">#{isInvoiced},</if>
|
||||||
|
<if test="isNeedBill != null">#{isNeedBill},</if>
|
||||||
SYSDATE()
|
SYSDATE()
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue