parent
b1238b9ce5
commit
3933f99a31
@ -0,0 +1,105 @@ |
||||
package com.bweb.controller; |
||||
|
||||
import com.github.pagehelper.PageHelper; |
||||
import com.github.pagehelper.PageInfo; |
||||
import com.hai.common.exception.ErrorCode; |
||||
import com.hai.common.exception.ErrorHelp; |
||||
import com.hai.common.exception.SysCode; |
||||
import com.hai.common.security.SessionObject; |
||||
import com.hai.common.security.UserCenter; |
||||
import com.hai.common.utils.DateUtil; |
||||
import com.hai.common.utils.ResponseMsgUtil; |
||||
import com.hai.entity.HighCouponHandsel; |
||||
import com.hai.entity.HighGoodsPriceRefer; |
||||
import com.hai.entity.HighMerchant; |
||||
import com.hai.model.HighCouponModel; |
||||
import com.hai.model.ResponseData; |
||||
import com.hai.model.UserInfoModel; |
||||
import com.hai.service.HighGoodsPriceReferService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import java.util.Date; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @Auther: 胡锐 |
||||
* @Description: |
||||
* @Date: 2021/3/21 20:11 |
||||
*/ |
||||
@Controller |
||||
@RequestMapping(value = "/highGoodsPriceRefer") |
||||
@Api(value = "产品价格配置接口") |
||||
public class HighGoodsPriceReferController { |
||||
|
||||
private static Logger log = LoggerFactory.getLogger(HighGoodsPriceReferController.class); |
||||
|
||||
@Autowired |
||||
private UserCenter userCenter; |
||||
|
||||
@Resource |
||||
private HighGoodsPriceReferService highGoodsPriceReferService; |
||||
|
||||
@RequestMapping(value="/insertGoodsPriceRefer",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "增加产品销售价格") |
||||
public ResponseData insertGoodsPriceRefer(@RequestBody HighGoodsPriceRefer highGoodsPriceRefer, HttpServletRequest request) { |
||||
try { |
||||
SessionObject sessionObject = userCenter.getSessionObject(request); |
||||
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); |
||||
if (highGoodsPriceRefer.getObjectType() == null |
||||
|| highGoodsPriceRefer.getObjectId() == null |
||||
|| highGoodsPriceRefer.getPromptlyType() == null |
||||
|| highGoodsPriceRefer.getNewSalePrice() == null |
||||
|| highGoodsPriceRefer.getEffectiveTime() == null) { |
||||
log.error("HighGoodsPriceReferController -> insertGoodsPriceRefer() error!","参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
highGoodsPriceRefer.setCreateTime(new Date()); |
||||
highGoodsPriceRefer.setStatus(101); // 状态: 0:删除 1:待编辑 2:待生效 3:已生效 4:已失效 101.审批中 102.审批驳回
|
||||
highGoodsPriceRefer.setOperatorId(userInfoModel.getSecUser().getId()); |
||||
highGoodsPriceRefer.setOperatorName(userInfoModel.getSecUser().getUserName()); |
||||
highGoodsPriceReferService.insertPriceRefer(highGoodsPriceRefer); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("HighGoodsPriceReferController -> insertGoodsPriceRefer() error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/getPriceReferList",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询价格列表") |
||||
public ResponseData getPriceReferList(@RequestParam(name = "objectType", required = true) Integer objectType, |
||||
@RequestParam(name = "objectId", required = true) Long objectId, |
||||
@RequestParam(name = "status", required = false) Integer status, |
||||
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
||||
@RequestParam(name = "pageSize", required = true) Integer pageSize) { |
||||
try { |
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("objectType", objectType); |
||||
map.put("objectId", objectId); |
||||
map.put("status", status); |
||||
|
||||
PageHelper.startPage(pageNum,pageSize); |
||||
return ResponseMsgUtil.success(new PageInfo<>(highGoodsPriceReferService.getPriceList(map))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("HighGoodsPriceReferController -> getPriceReferList() error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -1,5 +1,5 @@ |
||||
wxAppId=wx8d49e2f83025229d |
||||
wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df |
||||
mvn |
||||
|
||||
fileUrl=/home/project/hsg/filesystem |
||||
cmsPath=/home/project/hsg/filesystem/cmsPath |
||||
|
Loading…
Reference in new issue