| | |
| | | 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.*; |
| | |
| | | |
| | | @Autowired |
| | | private DeliveryItemService deliveryItemService; |
| | | |
| | | |
| | | @Autowired |
| | | private CompanysService companysService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:deliveryItem:list')") |
| | | @PostMapping("/deliveryItem/page") |
| | |
| | | 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"); |
| | | } |