rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/DeliveryItemController.java
@@ -9,9 +9,12 @@
import com.vincent.rsf.server.common.domain.BaseParam;
import com.vincent.rsf.server.common.domain.KeyValVo;
import com.vincent.rsf.server.common.domain.PageParam;
import com.vincent.rsf.server.manager.entity.Companys;
import com.vincent.rsf.server.manager.entity.DeliveryItem;
import com.vincent.rsf.server.manager.service.CompanysService;
import com.vincent.rsf.server.manager.service.DeliveryItemService;
import com.vincent.rsf.server.system.controller.BaseController;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@@ -24,6 +27,10 @@
    @Autowired
    private DeliveryItemService deliveryItemService;
    @Autowired
    private CompanysService companysService;
    @PreAuthorize("hasAuthority('manager:deliveryItem:list')")
    @PostMapping("/deliveryItem/page")
@@ -59,6 +66,10 @@
        deliveryItem.setCreateTime(new Date());
        deliveryItem.setUpdateBy(getLoginUserId());
        deliveryItem.setUpdateTime(new Date());
        if (StringUtils.isNotBlank(deliveryItem.getSplrName())) {
            Companys companys = companysService.getById(deliveryItem.getSplrName());
            deliveryItem.setSplrName(companys.getName()).setSplrCode(companys.getCode());
        }
        if (!deliveryItemService.save(deliveryItem)) {
            return R.error("Save Fail");
        }