Bläddra i källkod

店铺端MyBatisConfig同步,商品mapper补充storeId字段,相关代码补充

chenguo 1 vecka sedan
förälder
incheckning
a7d06eb010

+ 3 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java

@@ -90,6 +90,9 @@ public interface FsStoreProductScrmMapper
             "<if test = 'maps.companyIds != null and maps.companyIds != \"\" '> " +
             "and find_in_set(#{maps.companyIds}, p.company_ids) " +
             "</if>"+
+            "<if test = 'maps.storeId != null and maps.storeId != \"\" '> " +
+            "and store_id = #{maps.storeId} " +
+            "</if>"+
             "<if test = 'maps.storeIds != null '>" +
             "and store_id in " +
             "<foreach collection='maps.storeIds'  item='item' index='index'  open='(' separator=',' close=')'> #{item} </foreach>" +

+ 2 - 1
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java

@@ -322,6 +322,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
         product.setStock(Long.parseLong(countDto.getStock().toString()));
         product.setCompanyIds(param.getCompanyIds());
         product.setVideo(param.getVideo());
+        product.setStoreId(param.getStoreId());
         //校验店铺资质信息
         //获取店铺
         FsStoreScrm store = fsStoreScrmService.selectFsStoreByStoreId(product.getStoreId());
@@ -351,7 +352,7 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                     return R.error("商品类型错误");
             }
         }
-        if(param.getProductId() != null){
+        if(param.getProductId() != null && param.getProductId() > 0){
             //对已上架的商品进行修改需要重新审核
             if(1 == product.getIsShow() && "1".equals(product.getIsAudit())){
                 product.setIsAudit("0");

+ 7 - 3
fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml

@@ -66,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="contraindications" column="contraindications"/>
         <result property="precautions" column="precautions"/>
         <result property="isAudit" column="is_audit"/>
+        <result property="storeId" column="store_id"/>
     </resultMap>
 
     <sql id="selectFsStoreProductVo">
@@ -76,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                integral, product_type, prescribe_code, prescribe_spec, prescribe_factory, prescribe_name,
                is_display,tui_cate_id,company_ids,is_drug,drug_image,drug_reg_cert_no,common_name,dosage_form,
                unit_price,batch_number,mah,mah_address,manufacturer,manufacturer_address,indications,dosage,
-               adverse_reactions,contraindications,precautions,is_audit
+               adverse_reactions,contraindications,precautions,is_audit,store_id
                from fs_store_product_scrm
     </sql>
 
@@ -88,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                p.integral, p.product_type, p.prescribe_code, p.prescribe_spec, p.prescribe_factory, p.prescribe_name,
                p.is_display,p.tui_cate_id,p.company_ids,p.is_drug,p.drug_image,p.drug_reg_cert_no,p.common_name,p.dosage_form,
                p.unit_price,p.batch_number,p.mah,p.mah_address,p.manufacturer,p.manufacturer_address,p.indications,p.dosage,
-               p.adverse_reactions,p.contraindications,p.precautions,p.is_audit
+               p.adverse_reactions,p.contraindications,p.precautions,p.is_audit,p.store_id
         from fs_store_product_scrm p
     </sql>
 
@@ -156,7 +157,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="contraindications != null and contraindications != ''">and contraindications = #{contraindications} ,</if>
             <if test="precautions != null and precautions != ''">and precautions = #{precautions} ,</if>
             <if test="isAudit != null and isAudit != ''">and is_audit = #{isAudit} ,</if>
-
+            <if test="storeId != null and storeId != ''">and store_id = #{storeId} ,</if>
         </where>
     </select>
 
@@ -250,6 +251,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="contraindications != null and contraindications != ''">contraindications ,</if>
             <if test="precautions != null and precautions != ''">precautions ,</if>
             <if test="isAudit != null and isAudit != ''">is_audit ,</if>
+            <if test="storeId != null and storeId != ''">store_id ,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="image != null and image != ''">#{image},</if>
@@ -312,6 +314,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="contraindications != null and contraindications != ''">#{contraindications} ,</if>
             <if test="precautions != null and precautions != ''">#{precautions} ,</if>
             <if test="isAudit != null and isAudit != ''">#{isAudit} ,</if>
+            <if test="storeId != null and storeId != ''">#{storeId} ,</if>
          </trim>
     </insert>
 
@@ -378,6 +381,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="contraindications != null and contraindications != ''">contraindications = #{contraindications} ,</if>
             <if test="precautions != null and precautions != ''">precautions = #{precautions} ,</if>
             <if test="isAudit != null and isAudit != ''">is_audit = #{isAudit} ,</if>
+            <if test="storeId != null and storeId != ''">store_id = #{storeId} ,</if>
 
         </trim>
         where product_id = #{productId}

+ 8 - 7
fs-store/src/main/java/com/fs/framework/config/MyBatisConfig.java

@@ -1,5 +1,6 @@
 package com.fs.framework.config;
 
+import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
 import com.fs.common.utils.StringUtils;
 import org.apache.ibatis.io.VFS;
 import org.apache.ibatis.session.SqlSessionFactory;
@@ -27,7 +28,7 @@ import java.util.List;
 
 /**
  * Mybatis支持*匹配扫描包
- * 
+ *
 
  */
 @Configuration
@@ -117,17 +118,17 @@ public class MyBatisConfig
     @Bean
     public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception
     {
-        String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage");
-        String mapperLocations = env.getProperty("mybatis.mapperLocations");
-        String configLocation = env.getProperty("mybatis.configLocation");
+        String typeAliasesPackage = env.getProperty("mybatis-plus.typeAliasesPackage");
+        String mapperLocations = env.getProperty("mybatis-plus.mapperLocations");
+        String configLocation = env.getProperty("mybatis-plus.configLocation");
         typeAliasesPackage = setTypeAliasesPackage(typeAliasesPackage);
         VFS.addImplClass(SpringBootVFS.class);
 
-        final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
+        final MybatisSqlSessionFactoryBean sessionFactory = new MybatisSqlSessionFactoryBean();
         sessionFactory.setDataSource(dataSource);
         sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
-        sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, ",")));
+        sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(mapperLocations));
         sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
         return sessionFactory.getObject();
     }
-}
+}

+ 82 - 0
fs-store/src/main/java/com/fs/hisStore/controller/store/CompanyController.java

@@ -0,0 +1,82 @@
+package com.fs.hisStore.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.annotation.RepeatSubmit;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.domain.model.LoginUser;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.SecurityUtils;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.utils.sign.Md5Utils;
+import com.fs.company.domain.*;
+import com.fs.company.param.CompanyDeductParam;
+import com.fs.company.param.CompanyParam;
+import com.fs.company.param.CompanyRechargeParam;
+import com.fs.company.param.CompanyVoiceCallerParam;
+import com.fs.company.service.*;
+import com.fs.company.vo.CompanyCrmVO;
+import com.fs.company.vo.CompanyVO;
+import com.fs.company.vo.CompanyVoiceCallerListVO;
+import com.fs.core.utils.OrderCodeUtils;
+import com.fs.his.vo.OptionsVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 企业Controller
+ *
+ * @author fs
+ * @date 2021-10-04
+ */
+@RestController
+@RequestMapping("/company/company")
+public class CompanyController extends BaseController
+{
+    @Autowired
+    private ICompanyService companyService;
+    /**
+     * 查询企业列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:company:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CompanyParam param)
+    {
+        startPage();
+        List<CompanyVO> list = companyService.selectCompanyVOList(param);
+        return getDataTable(list);
+    }
+
+
+
+
+
+    @GetMapping("/getCompanyList")
+    public R getCompanyList()
+    {
+        Company map=new Company();
+        map.setIsDel(0);
+        List<Company> list = companyService.selectCompanyList(map);
+        return R.ok().put("data",list);
+    }
+
+
+
+
+
+
+    @GetMapping("/allList")
+    public TableDataInfo getHospital()
+    {
+        List<OptionsVO> list = companyService.selectAllCompanyList();
+        return getDataTable(list);
+    }
+}

+ 32 - 0
fs-store/src/main/java/com/fs/hisStore/controller/store/FsShippingTemplatesScrmController.java

@@ -0,0 +1,32 @@
+package com.fs.hisStore.controller.store;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+import com.fs.hisStore.domain.FsShippingTemplatesScrm;
+import com.fs.hisStore.service.IFsShippingTemplatesScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 运费模板Controller
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/shippingTemplates")
+public class FsShippingTemplatesScrmController extends BaseController
+{
+    @Autowired
+    private IFsShippingTemplatesScrmService fsShippingTemplatesService;
+
+    @GetMapping("/getAllList")
+    public R getAllList(FsShippingTemplatesScrm fsShippingTemplates)
+    {
+        fsShippingTemplates.setIsDel(0);
+        List<FsShippingTemplatesScrm> list = fsShippingTemplatesService.selectFsShippingTemplatesList(fsShippingTemplates);
+        return R.ok().put("data",list);
+    }
+}

+ 33 - 0
fs-store/src/main/java/com/fs/hisStore/controller/store/FsStoreProductRuleScrmController.java

@@ -0,0 +1,33 @@
+package com.fs.hisStore.controller.store;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+import com.fs.hisStore.domain.FsStoreProductRuleScrm;
+import com.fs.hisStore.service.IFsStoreProductRuleScrmService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 商品规则值(规格)Controller
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@RestController
+@RequestMapping("/store/store/storeProductRule")
+public class FsStoreProductRuleScrmController extends BaseController
+{
+    @Autowired
+    private IFsStoreProductRuleScrmService fsStoreProductRuleService;
+
+
+    @GetMapping("/getAllList")
+    public R getAllList(FsStoreProductRuleScrm fsStoreProductRule)
+    {
+        fsStoreProductRule.setIsDel(0);
+        List<FsStoreProductRuleScrm> list = fsStoreProductRuleService.selectFsStoreProductRuleList(fsStoreProductRule);
+        return R.ok().put("data",list);
+    }
+}

+ 9 - 3
fs-store/src/main/java/com/fs/hisStore/controller/store/FsStoreProductScrmController.java

@@ -18,7 +18,9 @@ import com.fs.hisStore.param.FsStoreProductAddEditParam;
 import com.fs.hisStore.service.IFsStoreProductAttrScrmService;
 import com.fs.hisStore.service.IFsStoreProductScrmService;
 import com.fs.hisStore.utils.UserUtil;
+import com.fs.hisStore.vo.FsStoreProductListVO;
 import com.fs.store.vo.FsStoreProductStoreExcelVO;
+import com.mysql.cj.util.StringUtils;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
@@ -47,11 +49,15 @@ public class FsStoreProductScrmController extends BaseController
  */
 
 @GetMapping("/list")
-public TableDataInfo list(FsStoreProductListSParam fsStoreProduct)
+public TableDataInfo list(FsStoreProductScrm fsStoreProduct)
 {
     startPage();
-    fsStoreProduct.setStoreId(UserUtil.getLoginUserStoreID());
-    List<FsStoreProductListSVO> list = fsStoreProductService.selectFsStoreProductListSVO(fsStoreProduct);
+    List<FsStoreProductListVO> list;
+    if(StringUtils.isNullOrEmpty(fsStoreProduct.getBarCode())){
+        list = fsStoreProductService.selectFsStoreProductListVO(fsStoreProduct);
+    }else{
+        list = fsStoreProductService.selectFsStoreProductBarCodeListVO(fsStoreProduct);
+    }
     return getDataTable(list);
 }