| @@ -7,11 +7,14 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.TtGoodsCategory; | import com.iformall.domain.po.TtGoodsCategory; | ||||
| import com.iformall.domain.po.WxMall; | |||||
| import com.iformall.domain.vo.TtMallGoodsCategoryVo; | import com.iformall.domain.vo.TtMallGoodsCategoryVo; | ||||
| import com.iformall.service.TtGoodsCategoryService; | import com.iformall.service.TtGoodsCategoryService; | ||||
| import com.iformall.service.TtMallGoodsCategoryService; | import com.iformall.service.TtMallGoodsCategoryService; | ||||
| import com.iformall.service.WxMallService; | |||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -29,16 +32,24 @@ public class TtMallGoodsCategoryController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private TtMallGoodsCategoryService ttMallGoodsCategoryService; | private TtMallGoodsCategoryService ttMallGoodsCategoryService; | ||||
| @Autowired | |||||
| private WxMallService wxMallService; | |||||
| @TenantIgnore | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("allTreeList") | @GetMapping("allTreeList") | ||||
| @ApiImplicitParams({}) | @ApiImplicitParams({}) | ||||
| @SystemControllerLog(description = "列表") | @SystemControllerLog(description = "列表") | ||||
| public ResultData allTreeList() { | |||||
| public ResultData allTreeList(String tenantId) { | |||||
| logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::allTreeList"); | logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::allTreeList"); | ||||
| return new ResultData(ttMallGoodsCategoryService.findAllTreeList(getTenantInfo())); | |||||
| if(StringUtils.isBlank(tenantId)){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"tenantId 为null"); | |||||
| } | |||||
| return new ResultData(ttMallGoodsCategoryService.findAllTreeList(tenantId)); | |||||
| } | } | ||||
| @TenantIgnore | |||||
| @ApiOperation("设置软件服务费") | @ApiOperation("设置软件服务费") | ||||
| @PostMapping("setMallSoftwareFee") | @PostMapping("setMallSoftwareFee") | ||||
| @ApiImplicitParams({}) | @ApiImplicitParams({}) | ||||
| @@ -48,7 +59,14 @@ public class TtMallGoodsCategoryController extends BaseController { | |||||
| if(record.getCategoryId() == null || record.getMallSoftwareFee() == null){ | if(record.getCategoryId() == null || record.getMallSoftwareFee() == null){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | ||||
| } | } | ||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| if(record.getTenantId() == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"tenantId 为null"); | |||||
| } | |||||
| WxMall mall = wxMallService.getByTenantId(record.getTenantId()); | |||||
| if(mall == null){ | |||||
| return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); | |||||
| } | |||||
| record.updateTenantInfo(mall); | |||||
| ttMallGoodsCategoryService.updateFee(record); | ttMallGoodsCategoryService.updateFee(record); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| @@ -10,7 +10,7 @@ import java.util.List; | |||||
| public interface TtMallGoodsCategoryService { | public interface TtMallGoodsCategoryService { | ||||
| List<TtMallGoodsCategoryVo> findAllTreeList(TenantEntity tenantInfo); | |||||
| List<TtMallGoodsCategoryVo> findAllTreeList(String tenantId); | |||||
| void updateFee(TtMallGoodsCategoryVo record); | void updateFee(TtMallGoodsCategoryVo record); | ||||
| @@ -40,9 +40,10 @@ public class TtMallGoodsCategoryServiceImpl implements TtMallGoodsCategoryServic | |||||
| @Override | @Override | ||||
| public List<TtMallGoodsCategoryVo> findAllTreeList(TenantEntity tenantInfo) { | |||||
| public List<TtMallGoodsCategoryVo> findAllTreeList(String tenantId) { | |||||
| TtMallGoodsCategoryVo mgcVoQ = new TtMallGoodsCategoryVo(); | TtMallGoodsCategoryVo mgcVoQ = new TtMallGoodsCategoryVo(); | ||||
| mgcVoQ.updateTenantInfo(tenantInfo); | |||||
| // mgcVoQ.updateTenantInfo(tenantInfo); | |||||
| mgcVoQ.setTenantId(tenantId); | |||||
| mgcVoQ.setIsDel(EnumYesOrNo.NO.getCode()); | mgcVoQ.setIsDel(EnumYesOrNo.NO.getCode()); | ||||
| mgcVoQ.setSortColumns(BaseEntity.SortField.Id_ASC); | mgcVoQ.setSortColumns(BaseEntity.SortField.Id_ASC); | ||||
| List<TtMallGoodsCategoryVo> listAll = ttMallGoodsCategoryMapper.findAllTreeList(mgcVoQ); | List<TtMallGoodsCategoryVo> listAll = ttMallGoodsCategoryMapper.findAllTreeList(mgcVoQ); | ||||
| @@ -141,11 +142,11 @@ public class TtMallGoodsCategoryServiceImpl implements TtMallGoodsCategoryServic | |||||
| List<TtMallGoodsCategory> childList = new ArrayList<>(); | List<TtMallGoodsCategory> childList = new ArrayList<>(); | ||||
| for (Integer childId:childIds) { | for (Integer childId:childIds) { | ||||
| TtMallGoodsCategory child = new TtMallGoodsCategory(); | TtMallGoodsCategory child = new TtMallGoodsCategory(); | ||||
| old.setGoodsCategoryId(childId); | |||||
| old.updateTenantInfo(tenantEntity); | |||||
| old.setSoftwareFee(softwareFee); | |||||
| old.setCreateDate(now); | |||||
| old.setUpdateDate(now); | |||||
| child.setGoodsCategoryId(childId); | |||||
| child.updateTenantInfo(tenantEntity); | |||||
| child.setSoftwareFee(softwareFee); | |||||
| child.setCreateDate(now); | |||||
| child.setUpdateDate(now); | |||||
| childList.add(child); | childList.add(child); | ||||
| } | } | ||||
| ttMallGoodsCategoryMapper.insertList(childList); | ttMallGoodsCategoryMapper.insertList(childList); | ||||
| @@ -71,7 +71,7 @@ | |||||
| (#{item.goodsCategoryId,jdbcType=INTEGER}, | (#{item.goodsCategoryId,jdbcType=INTEGER}, | ||||
| #{item.tenantId,jdbcType=VARCHAR}, | #{item.tenantId,jdbcType=VARCHAR}, | ||||
| #{item.parentTenantId,jdbcType=VARCHAR}, | #{item.parentTenantId,jdbcType=VARCHAR}, | ||||
| #{item.software_fee,jdbcType=INTEGER}, | |||||
| #{item.softwareFee,jdbcType=INTEGER}, | |||||
| #{item.createDate,jdbcType=TIMESTAMP}, | #{item.createDate,jdbcType=TIMESTAMP}, | ||||
| #{item.updateDate,jdbcType=TIMESTAMP}) | #{item.updateDate,jdbcType=TIMESTAMP}) | ||||
| </foreach> | </foreach> | ||||
| @@ -81,7 +81,7 @@ | |||||
| <resultMap id="BaseResultMapVo" type="com.iformall.domain.vo.TtMallGoodsCategoryVo"> | <resultMap id="BaseResultMapVo" type="com.iformall.domain.vo.TtMallGoodsCategoryVo"> | ||||
| <result column="id" jdbcType="INTEGER" property="id" /> | |||||
| <result column="id" jdbcType="INTEGER" property="categoryId" /> | |||||
| <result column="level" jdbcType="INTEGER" property="level" /> | <result column="level" jdbcType="INTEGER" property="level" /> | ||||
| <result column="name" jdbcType="VARCHAR" property="name" /> | <result column="name" jdbcType="VARCHAR" property="name" /> | ||||
| <result column="parent_id" jdbcType="INTEGER" property="parentId" /> | <result column="parent_id" jdbcType="INTEGER" property="parentId" /> | ||||