| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ycl.api.CommonPage; |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.common.util.UtilNumber; |
| | | import com.ycl.dto.UmsStoreInfoParam; |
| | | import com.ycl.entity.store.StoreInfo; |
| | | import com.ycl.service.store.StoreInfoService; |
| | |
| | | @Api(tags = "门店管理") |
| | | public class StoreInfoController { |
| | | private StoreInfoService storeInfoService; |
| | | |
| | | @Autowired |
| | | UtilNumber utilNumber; |
| | | |
| | | @Autowired |
| | | public void setUmsStoreInfoService(StoreInfoService umsStoreInfoService) { |
| | |
| | | public CommonResult<StoreInfo> add(@Validated @RequestBody UmsStoreInfoParam umsStoreInfoParam) { |
| | | StoreInfo storeInfo = StoreInfo.builder() |
| | | .owner(umsStoreInfoParam.getOwner()) |
| | | .storename(umsStoreInfoParam.getStorename()) |
| | | .storeName(umsStoreInfoParam.getStorename()) |
| | | .contact(umsStoreInfoParam.getContact()) |
| | | .storeaddr(umsStoreInfoParam.getStoreaddr()) |
| | | .storephoto(umsStoreInfoParam.getStorephoto()) |
| | | .idcardinfo(umsStoreInfoParam.getIdcardinfo()) |
| | | .storescore(umsStoreInfoParam.getStorescore()).build(); |
| | | .storeAddress(umsStoreInfoParam.getStoreaddr()) |
| | | .storePhoto(umsStoreInfoParam.getStorephoto()) |
| | | .idCardInfo(umsStoreInfoParam.getIdcardinfo()) |
| | | .storeNumber(utilNumber.createShopCode()) |
| | | .storeScore(umsStoreInfoParam.getStorescore()).build(); |
| | | boolean success = storeInfoService.save(storeInfo); |
| | | if (success) { |
| | | return CommonResult.success(null); |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "修改门店信息") |
| | | @RequestMapping(value = "/update", method = RequestMethod.GET) |
| | | @RequestMapping(value = "/update", method = RequestMethod.PUT) |
| | | @ResponseBody |
| | | public CommonResult update(@RequestBody StoreInfo storeInfo) { |
| | | boolean success = storeInfoService.updateById(storeInfo); |