|
|
@@ -1,5 +1,6 @@
|
|
|
package com.fs.hisStore.controller;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.fs.common.annotation.Log;
|
|
|
import com.fs.common.core.controller.BaseController;
|
|
|
@@ -48,8 +49,7 @@ import java.util.Map;
|
|
|
@Slf4j
|
|
|
@RestController
|
|
|
@RequestMapping("/store/store/storeProduct")
|
|
|
-public class FsStoreProductScrmController extends BaseController
|
|
|
-{
|
|
|
+public class FsStoreProductScrmController extends BaseController {
|
|
|
@Autowired
|
|
|
private IFsStoreProductScrmService fsStoreProductService;
|
|
|
|
|
|
@@ -64,27 +64,27 @@ public class FsStoreProductScrmController extends BaseController
|
|
|
private FsStore580FacadeService fsStore580FacadeService;
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 批量修改商品
|
|
|
+ *
|
|
|
* @param modifyMoreDTO
|
|
|
* @return
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('store:storeProduct:list')")
|
|
|
@PostMapping("/batchModify")
|
|
|
- @Log(title = "商品管理", businessType = BusinessType.UPDATE,isStoreLog = true,logParam = {"商品","批量修改商品信息"})
|
|
|
- public R batchModify(@RequestBody ModifyMoreDTO modifyMoreDTO){
|
|
|
+ @Log(title = "商品管理", businessType = BusinessType.UPDATE, isStoreLog = true, logParam = {"商品", "批量修改商品信息"})
|
|
|
+ public R batchModify(@RequestBody ModifyMoreDTO modifyMoreDTO) {
|
|
|
fsStoreProductService.batchModify(modifyMoreDTO);
|
|
|
return R.ok();
|
|
|
}
|
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('store:storeProduct:list')")
|
|
|
@PostMapping("/batchAudit")
|
|
|
- @Log(title = "商品审核", businessType = BusinessType.AUDIT,isStoreLog = true,logParam = {"商品","批量审核商品信息"},
|
|
|
- logParamExpression = "#p0.getProductIds().size()>1?"
|
|
|
- +"(#p0.isAudit==1?new String[]{'商品','商品批量审核通过'}: new String[]{'商品','商品批量审核退回'}):" +
|
|
|
- "(#p0.isAudit==1?new String[]{'商品','商品审核通过'}: new String[]{'商品','商品审核退回'})")
|
|
|
- public R batchAudit(@RequestBody ProductAuditDTO auditDTO){
|
|
|
+ @Log(title = "商品审核", businessType = BusinessType.AUDIT, isStoreLog = true, logParam = {"商品", "批量审核商品信息"},
|
|
|
+ logParamExpression = "#p0.getProductIds().size()>1?"
|
|
|
+ + "(#p0.isAudit==1?new String[]{'商品','商品批量审核通过'}: new String[]{'商品','商品批量审核退回'}):" +
|
|
|
+ "(#p0.isAudit==1?new String[]{'商品','商品审核通过'}: new String[]{'商品','商品审核退回'})")
|
|
|
+ public R batchAudit(@RequestBody ProductAuditDTO auditDTO) {
|
|
|
fsStoreProductService.batchAudit(auditDTO);
|
|
|
return R.ok();
|
|
|
}
|
|
|
@@ -94,14 +94,13 @@ public class FsStoreProductScrmController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('store:storeProduct:list')")
|
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(FsStoreProductScrm fsStoreProduct)
|
|
|
- {
|
|
|
+ public TableDataInfo list(FsStoreProductScrm fsStoreProduct) {
|
|
|
log.info("查询商品列表 参数: {}", fsStoreProduct);
|
|
|
startPage();
|
|
|
List<FsStoreProductListVO> list;
|
|
|
- if(StringUtils.isNullOrEmpty(fsStoreProduct.getBarCode())){
|
|
|
+ if (StringUtils.isNullOrEmpty(fsStoreProduct.getBarCode())) {
|
|
|
list = fsStoreProductService.selectFsStoreProductListVO(fsStoreProduct);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
list = fsStoreProductService.selectFsStoreProductBarCodeListVO(fsStoreProduct);
|
|
|
}
|
|
|
return getDataTable(list);
|
|
|
@@ -111,21 +110,19 @@ public class FsStoreProductScrmController extends BaseController
|
|
|
* 导出商品列表
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('store:storeProduct:export')")
|
|
|
- @Log(title = "商品管理", businessType = BusinessType.EXPORT, isStoreLog = true,logParam = {"商品","导出商品信息"})
|
|
|
+ @Log(title = "商品管理", businessType = BusinessType.EXPORT, isStoreLog = true, logParam = {"商品", "导出商品信息"})
|
|
|
@GetMapping("/export")
|
|
|
- public AjaxResult export(FsStoreProductScrm fsStoreProduct)
|
|
|
- {
|
|
|
+ public AjaxResult export(FsStoreProductScrm fsStoreProduct) {
|
|
|
List<FsStoreProductExportVO> list = fsStoreProductService.selectFsStoreProductExportList(fsStoreProduct);
|
|
|
ExcelUtil<FsStoreProductExportVO> util = new ExcelUtil<FsStoreProductExportVO>(FsStoreProductExportVO.class);
|
|
|
return util.exportExcel(list, "storeProduct");
|
|
|
}
|
|
|
|
|
|
|
|
|
- @Log(title = "商品管理", businessType = BusinessType.IMPORT,isStoreLog = true,logParam = {"商品","商品导入"})
|
|
|
+ @Log(title = "商品管理", businessType = BusinessType.IMPORT, isStoreLog = true, logParam = {"商品", "商品导入"})
|
|
|
@PreAuthorize("@ss.hasPermi('store:storeProduct:import')")
|
|
|
@PostMapping("/importData")
|
|
|
- public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
|
|
- {
|
|
|
+ public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
|
|
ExcelUtil<FsStoreProductExportVO> util = new ExcelUtil<>(FsStoreProductExportVO.class);
|
|
|
List<FsStoreProductExportVO> list = util.importExcel(file.getInputStream());
|
|
|
String message = fsStoreProductService.importStoreProduct(list, updateSupport);
|
|
|
@@ -134,8 +131,7 @@ public class FsStoreProductScrmController extends BaseController
|
|
|
|
|
|
|
|
|
@GetMapping("/importTemplate")
|
|
|
- public AjaxResult importTemplate()
|
|
|
- {
|
|
|
+ public AjaxResult importTemplate() {
|
|
|
ExcelUtil<FsStoreProductExportVO> util = new ExcelUtil<>(FsStoreProductExportVO.class);
|
|
|
return util.importTemplateExcel("商品数据");
|
|
|
}
|
|
|
@@ -145,45 +141,40 @@ public class FsStoreProductScrmController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('store:storeProduct:query')")
|
|
|
@GetMapping(value = "/{productId}")
|
|
|
- public R getInfo(@PathVariable("productId") Long productId)
|
|
|
- {
|
|
|
- FsStoreProductScrm product=fsStoreProductService.selectFsStoreProductById(productId);
|
|
|
- List<FsStoreProductAttrScrm> attrs=attrService.selectFsStoreProductAttrByProductId(productId);
|
|
|
- return R.ok().put("data",product).put("attrs", attrs);
|
|
|
+ public R getInfo(@PathVariable("productId") Long productId) {
|
|
|
+ FsStoreProductScrm product = fsStoreProductService.selectFsStoreProductById(productId);
|
|
|
+ List<FsStoreProductAttrScrm> attrs = attrService.selectFsStoreProductAttrByProductId(productId);
|
|
|
+ return R.ok().put("data", product).put("attrs", attrs);
|
|
|
}
|
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('store:storeProduct:add')")
|
|
|
@Log(title = "商品管理", businessType = BusinessType.INSERT, businessTypeExpression = "#p0.getProductId()>0? T(com.fs.common.enums.BusinessType).UPDATE: T(com.fs.common.enums.BusinessType).INSERT"
|
|
|
, isStoreLog = true, logParamExpression = "#p0.getProductId()>0? new String[]{'商品','修改商品'}: new String[]{'商品','新增商品'}")
|
|
|
@PostMapping(value = "/addOrEdit")
|
|
|
- public R addOrEdit(@RequestBody FsStoreProductAddEditParam fsStoreProduct)
|
|
|
- {
|
|
|
- if(ObjectUtils.isNotNull(fsStoreProduct.getIsShow())) {
|
|
|
- if (fsStoreProduct.getIsShow() ==1){
|
|
|
- logger.info("商品上架:{}",fsStoreProduct.getProductName()+new Date());
|
|
|
+ public R addOrEdit(@RequestBody FsStoreProductAddEditParam fsStoreProduct) {
|
|
|
+ if (ObjectUtils.isNotNull(fsStoreProduct.getIsShow())) {
|
|
|
+ if (fsStoreProduct.getIsShow() == 1) {
|
|
|
+ logger.info("商品上架:{}", fsStoreProduct.getProductName() + new Date());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(ObjectUtils.isNotNull(fsStoreProduct.getIsDisplay())) {
|
|
|
- if (fsStoreProduct.getIsDisplay() ==1){
|
|
|
- logger.info("商品前端展示:{}",fsStoreProduct.getProductName()+new Date());
|
|
|
+ if (ObjectUtils.isNotNull(fsStoreProduct.getIsDisplay())) {
|
|
|
+ if (fsStoreProduct.getIsDisplay() == 1) {
|
|
|
+ logger.info("商品前端展示:{}", fsStoreProduct.getProductName() + new Date());
|
|
|
}
|
|
|
}
|
|
|
return fsStoreProductService.addOrEdit(fsStoreProduct);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 删除商品
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('store:storeProduct:remove')")
|
|
|
- @Log(title = "商品管理", businessType = BusinessType.DELETE,isStoreLog = true,
|
|
|
- logParamExpression ="#p0.length>1?new String[]{'商品','批量删除商品信息'}: new String[]{'商品','删除商品信息'}" )
|
|
|
- @DeleteMapping("/{productIds}")
|
|
|
- public AjaxResult remove(@PathVariable Long[] productIds)
|
|
|
- {
|
|
|
+ @Log(title = "商品管理", businessType = BusinessType.DELETE, isStoreLog = true,
|
|
|
+ logParamExpression = "#p0.length>1?new String[]{'商品','批量删除商品信息'}: new String[]{'商品','删除商品信息'}")
|
|
|
+ @DeleteMapping("/{productIds}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] productIds) {
|
|
|
return toAjax(fsStoreProductService.deleteFsStoreProductByIds(productIds));
|
|
|
}
|
|
|
|
|
|
@@ -192,47 +183,44 @@ public class FsStoreProductScrmController extends BaseController
|
|
|
* 批量复制商品
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('store:storeProduct:bulkCopy')")
|
|
|
- @Log(title = "商品管理", businessType = BusinessType.UPDATE,isStoreLog = true,
|
|
|
- logParamExpression ="#p0.length>1?new String[]{'商品','批量复制商品信息'}: new String[]{'商品','复制商品信息'}" )
|
|
|
+ @Log(title = "商品管理", businessType = BusinessType.UPDATE, isStoreLog = true,
|
|
|
+ logParamExpression = "#p0.length>1?new String[]{'商品','批量复制商品信息'}: new String[]{'商品','复制商品信息'}")
|
|
|
@GetMapping("/bulkCopy/{productIds}")
|
|
|
- public R bulkCopy(@PathVariable Long[] productIds)
|
|
|
- {
|
|
|
+ public R bulkCopy(@PathVariable Long[] productIds) {
|
|
|
return fsStoreProductService.bulkCopyFsStoreProductByIds(productIds);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "生成属性")
|
|
|
@PostMapping(value = "/genFormatAttr/{productId}")
|
|
|
- public ResponseEntity genFormatAttr(@PathVariable Long productId, @RequestBody String jsonStr,Long[] stores){
|
|
|
- return new ResponseEntity<>(fsStoreProductService.getFormatAttr(productId,jsonStr, stores), HttpStatus.OK);
|
|
|
+ public ResponseEntity genFormatAttr(@PathVariable Long productId, @RequestBody String jsonStr, Long[] stores) {
|
|
|
+ return new ResponseEntity<>(fsStoreProductService.getFormatAttr(productId, jsonStr, stores), HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
|
|
|
@GetMapping("/getStoreProductAttrValueList")
|
|
|
- public TableDataInfo getStoreProductAttrValueList(FsProductAttrValueParam param)
|
|
|
- {
|
|
|
+ public TableDataInfo getStoreProductAttrValueList(FsProductAttrValueParam param) {
|
|
|
startPage();
|
|
|
- List<FsStoreProductAttrValueVO> list=attrValueService.selectFsStoreProductAttrValueListVO(param);
|
|
|
+ List<FsStoreProductAttrValueVO> list = attrValueService.selectFsStoreProductAttrValueListVO(param);
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
@ApiOperation("获取推广商品列表")
|
|
|
@GetMapping("/getStoreTuiProductAttrValueList")
|
|
|
- public TableDataInfo getStoreTuiProductAttrValueList(FsStoreTuiProductAttrValueParam param, HttpServletRequest request){
|
|
|
+ public TableDataInfo getStoreTuiProductAttrValueList(FsStoreTuiProductAttrValueParam param, HttpServletRequest request) {
|
|
|
startPage();
|
|
|
- List<FsStoreTuiProductAttrValueVO> list=attrValueService.selectStoreTuiProductAttrValueVOList(param);
|
|
|
+ List<FsStoreTuiProductAttrValueVO> list = attrValueService.selectStoreTuiProductAttrValueVOList(param);
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/listBySearch")
|
|
|
- public R listBySearCh(FsStoreProductScrm product)
|
|
|
- {
|
|
|
+ public R listBySearCh(FsStoreProductScrm product) {
|
|
|
List<FsStoreProductScrm> list = fsStoreProductService.selectFsStoreProductList(product);
|
|
|
- return R.ok().put("data",list);
|
|
|
+ return R.ok().put("data", list);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取店铺商品表字段
|
|
|
- * */
|
|
|
+ */
|
|
|
@GetMapping("/getStoreProductColumns")
|
|
|
public R getStoreProductColumns() {
|
|
|
List<Map<String, String>> list = fsStoreProductService.getStoreProductColumns();
|
|
|
@@ -244,11 +232,10 @@ public class FsStoreProductScrmController extends BaseController
|
|
|
* 同步商品到580商城
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('store:storeProduct:sync')")
|
|
|
- @Log(title = "同步商品到580医院", businessType = BusinessType.DELETE,isStoreLog = true,
|
|
|
- logParamExpression ="#p0.length>1?new String[]{'商品','同步商品到580医院'}: new String[]{'商品','同步商品到580医院'}" )
|
|
|
+ @Log(title = "同步商品到580医院", businessType = BusinessType.DELETE, isStoreLog = true,
|
|
|
+ logParamExpression = "#p0.length>1?new String[]{'商品','同步商品到580医院'}: new String[]{'商品','同步商品到580医院'}")
|
|
|
@PostMapping("/sync580/{productIds}")
|
|
|
- public R sync(@PathVariable Long[] productIds)
|
|
|
- {
|
|
|
+ public R sync(@PathVariable Long[] productIds) {
|
|
|
fsStoreHospital580ScrmService.SynDrugToHospital580(productIds);
|
|
|
return R.ok("同步成功");
|
|
|
}
|
|
|
@@ -257,14 +244,27 @@ public class FsStoreProductScrmController extends BaseController
|
|
|
* 同步商品到580商城
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('store:storeProduct:update')")
|
|
|
- @Log(title = "批量下架商品", businessType = BusinessType.DELETE,isStoreLog = true,
|
|
|
- logParamExpression ="#p0.length>1?new String[]{'商品','下架'}: new String[]{'商品','下架'}" )
|
|
|
+ @Log(title = "批量下架商品", businessType = BusinessType.DELETE, isStoreLog = true,
|
|
|
+ logParamExpression = "#p0.length>1?new String[]{'商品','下架'}: new String[]{'商品','下架'}")
|
|
|
@PostMapping("/updateFsStoreProductIsShowBatch/{productIds}")
|
|
|
- public R updateFsStoreProductIsShowBatch(@PathVariable Long[] productIds)
|
|
|
- {
|
|
|
- if (productIds.length>0){
|
|
|
+ public R updateFsStoreProductIsShowBatch(@PathVariable Long[] productIds) {
|
|
|
+ if (productIds.length > 0) {
|
|
|
fsStoreProductService.updateFsStoreProductIsShowBatch(productIds);
|
|
|
}
|
|
|
return R.ok("操作完成");
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 商品资质信息提示
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/productNoticeInfo")
|
|
|
+ public R getProductNoticeInfo() {
|
|
|
+ List<String> productNoticeInfo = fsStoreProductService.getProductNoticeInfo();
|
|
|
+ if (!CollectionUtils.isEmpty(productNoticeInfo)) {
|
|
|
+ return R.ok().put("code", 200).put("data", productNoticeInfo);
|
|
|
+ }
|
|
|
+ return R.ok().put("code", 0);
|
|
|
+ }
|
|
|
}
|