'修复已知问题'

dev-discount
= 4 years ago
parent 391f69b5ee
commit 590cbe1f46
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/SecUserController.java
  2. 66
      hai-cweb/src/main/java/com/cweb/controller/CmsContentController.java
  3. 8
      hai-service/src/main/java/com/hai/dao/SecUserMapperExt.java
  4. 22
      hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java

@ -77,7 +77,7 @@ public class SecUserController {
}
if(!secUser.getPassword().equals(MD5Util.encode(oldPassword.getBytes()))) {
log.error("BaseMemberController --> sendUserPass() error!","旧密码不一致");
throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, "旧密码不一致");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "旧密码不一致");
}
secUser.setPassword(MD5Util.encode(password.getBytes()));
//修改

@ -0,0 +1,66 @@
package com.cweb.controller;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.BsCompany;
import com.hai.entity.CmsContent;
import com.hai.entity.CmsPatch;
import com.hai.entity.SecRegion;
import com.hai.model.CmsContentModel;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.BsCompanyService;
import com.hai.service.CmsContentService;
import com.hai.service.CmsPatchService;
import com.hai.service.CommonService;
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.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
@Controller
@Api(value = "内容管理 内容发布")
@RequestMapping(value = "/cmsContent")
public class CmsContentController {
private static Logger log = LoggerFactory.getLogger(CmsContentController.class);
@Resource
private CommonService commonService;
@Resource
private CmsContentService cmsContentService;
@Resource
private BsCompanyService bsCompanyService;
@RequestMapping(value = "/getCorporateAdvertising", method = RequestMethod.GET)
@ApiOperation(value = "查询首页轮播图")
@ResponseBody
public ResponseData getCorporateAdvertising(@RequestParam(name = "regionId", required = true) String regionId) {
try {
SecRegion region = commonService.getParentByRegion(Long.parseLong(regionId));
if (region != null) {
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString());
if (bsCompany != null) {
Map<String,String> map = new HashMap<>();
map.put("companyId", bsCompany.getId().toString());
map.put("status", "2");
map.put("categoryCode", "HOME_IMG");
return ResponseMsgUtil.success(cmsContentService.getListContent(map));
}
}
return ResponseMsgUtil.success(new ArrayList<>());
} catch (Exception e) {
log.error("CmsContentController --> getCorporateAdvertising() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -60,11 +60,11 @@ public interface SecUserMapperExt {
" * " +
" FROM" +
" sec_user su " +
" WHERE" +
" STATUS = 1 " +
" WHERE " +
" (su.login_name = #{loginName} " +
" OR su.telephone = #{loginName}) " +
" AND su.`password` = #{password}" +
" AND su.login_name = #{loginName} " +
" OR su.telephone = #{loginName} " +
" AND STATUS = 1 " +
"</script>"
})
@Results({

@ -6,6 +6,7 @@ import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.IDGenerator;
import com.hai.dao.HighChildOrderMapper;
import com.hai.dao.HighCouponCodeMapper;
import com.hai.dao.HighCouponCodeMapperExt;
import com.hai.entity.*;
@ -49,6 +50,9 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService {
@Resource
private HighCouponAgentService highCouponAgentService;
@Resource
private HighChildOrderMapper highChildOrderMapper;
@Override
public void insertCouponCode(HighCouponCode highCouponCode) {
highCouponCodeMapper.insert(highCouponCode);
@ -157,15 +161,19 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService {
List<HighUserCoupon> list = highUserCouponService.getUserCouponList(map);
if (list.size() > 0) {
for (HighUserCoupon userCoupon : list) {
HighChildOrder order = highOrderService.getChildOrderByUserGoods(userCoupon.getUserId(), 1, userCoupon.getCouponId());
HighChildOrderExample example = new HighChildOrderExample();
example.createCriteria().andMemIdEqualTo(userCoupon.getUserId()).andGoodsTypeEqualTo(1).andGoodsIdEqualTo(userCoupon.getCouponId()).andChildOrdeStatusEqualTo(2);
List<HighChildOrder> childOrderList = highChildOrderMapper.selectByExample(example);
if (childOrderList.size() > 0) {
userCoupon.setConsumeTime(useTime);
userCoupon.setStatus(2); // 状态 0:已过期 1:未使用 2:已使用
highUserCouponService.updateUserCoupon(userCoupon);
highOrderService.childOrderComplete(childOrderList.get(0).getId());
}
/*HighChildOrder order = highOrderService.getChildOrderByUserGoods(userCoupon.getUserId(), 1, userCoupon.getCouponId());
if (order == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单");
}
userCoupon.setConsumeTime(useTime);
userCoupon.setStatus(2); // 状态 0:已过期 1:未使用 2:已使用
highUserCouponService.updateUserCoupon(userCoupon);
highOrderService.childOrderComplete(order.getId());
}*/
}
}
}

Loading…
Cancel
Save