json存储
1.需求分析:
功能实现基于 后台管理的 发票管理功能
功能为:当状态为未发货时,点击发货 选择快递公司,将发货的快递公司和单号保存到物流信息字段,更改状态为 已发货
如图,将物流单号和快递公司的名字和code保存到 物流信息(这是我们服务端要求的,应该是有需求)
2.功能实现:
首先 页面的实现,因为我是管理后台前后端一起写,所有前端页面也是我写,用到的layui。
一、 前端代码:
略过,需要的话 找我要。
二、上代码
1.controller
/**
* 跳转发货
*/
@RequestMapping("/deliveryPage")
public String deliveryPage(Model model, String orderNo, String receiveMobile, String receiveName, String receiveAddr) {
//快递公司数据
String type = dictTypeService.getDictByCode(LogisticsConstant.dictKey).get(0).getDescription();
List<LogisticsCompanyResult> companyList = logisticsCompanyService.listByType(type);
List<Map<String, String>> ListCate = new ArrayList<>();
for (LogisticsCompanyResult logistic : companyList) {
Map<String, String> logistics = new HashMap<>();
logistics.put("logisticsName", logistic.getLogisticsName());
logistics.put("logisticsCode", logistic.getLogisticsCode())