提交代码

dev-discount
胡锐 2 years ago
parent 5d489334cf
commit c0b4ed31f2
  1. 45
      hai-bweb/src/main/java/com/bweb/controller/HighGasController.java
  2. 21
      hai-bweb/src/main/java/com/bweb/controller/SecUserController.java
  3. 42
      hai-service/src/main/java/com/hai/dao/HighMerchantStoreMapperExt.java
  4. 150
      hai-service/src/main/java/com/hai/model/GasSelfBuiltStationModel.java
  5. 7
      hai-service/src/main/java/com/hai/service/HighMerchantStoreService.java
  6. 6
      hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java
  7. 18
      hai-service/src/main/java/com/hai/service/impl/SecUserServiceImpl.java

@ -728,6 +728,51 @@ public class HighGasController {
}
}
@RequestMapping(value="/getGasSelfBuiltStationList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询油站列表")
public ResponseData getGasSelfBuiltStationList(@RequestParam(name = "companyId", required = false) Long companyId,
@RequestParam(name = "merId", required = false) Long merId,
@RequestParam(name = "gasName", required = false) String gasName,
@RequestParam(name = "prestoreType", required = false) String prestoreType,
@RequestParam(name = "amountsEarlyWarningStatus", required = false) Boolean amountsEarlyWarningStatus,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
Map<String, Object> param = new HashMap<>();
param.put("gasName", gasName);
param.put("prestoreType", prestoreType);
param.put("amountsEarlyWarningStatus", amountsEarlyWarningStatus);
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type0.getType())) {
param.put("companyId", userInfoModel.getBsCompany().getId());
param.put("merId", merId);
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type1.getType())) {
param.put("merId", merId);
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type2.getType())) {
param.put("merId", userInfoModel.getMerchant().getId());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(merchantStoreService.getGasSelfBuiltStationList(param)));
} catch (Exception e) {
log.error("HighGasController -> getGasPriceDetail() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/refuelingOrderRefund",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "订单退款")

@ -12,12 +12,14 @@ import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.BsOrganization;
import com.hai.entity.SecRole;
import com.hai.entity.SecUser;
import com.hai.entity.SecUserLabel;
import com.hai.model.ResponseData;
import com.hai.model.SecUserModel;
import com.hai.model.UserInfoModel;
import com.hai.model.UserTreeModel;
import com.hai.service.BsOrganizationService;
import com.hai.service.SecRoleService;
import com.hai.service.SecUserLabelService;
import com.hai.service.SecUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -30,7 +32,9 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Controller
@RequestMapping(value = "/secUser")
@ -51,6 +55,8 @@ public class SecUserController {
@Resource
private SecRoleService secRoleService;
@Resource
private SecUserLabelService userLabelService;
@RequestMapping(value="/sendUserPass",method = RequestMethod.POST)
@ResponseBody
@ -227,6 +233,21 @@ public class SecUserController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
SecUser user = secUserService.findById(userId);
if (user != null) {
List<SecUserLabel> labelList = userLabelService.getLabelByUser(user.getId());
List<Long> labelIdArray = new ArrayList<>();
List<String> labelNameArray = new ArrayList<>();
for (SecUserLabel label : labelList) {
labelIdArray.add(label.getLabelId());
}
user.setLabelIdArray(labelIdArray);
for (SecUserLabel label : labelList) {
labelNameArray.add(label.getLabelName());
}
user.setLabelNameArray(labelNameArray);
}
SecRole role = secRoleService.getRoleByUserId(userId);
user.setRoleId(role.getId());
return ResponseMsgUtil.success(user);

@ -1,7 +1,47 @@
package com.hai.dao;
import com.hai.model.GasSelfBuiltStationModel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
* mapper扩展类
*/
public interface HighMerchantStoreMapperExt {
}
@Select({
"<script>" +
" select" +
" a.id storeId," +
" a.merchant_id storeMerId," +
" c.merchant_name storeMerName," +
" d.id companyId," +
" d.`name` companyName," +
" a.region_id regionId, " +
" a.region_name regionName," +
" a.store_key storeKey, " +
" a.store_name storeName," +
" a.address storeAddress," +
" a.prestore_type storePrestoreType," +
" b.amounts amounts," +
" b.amounts_early_warning amountsEarlyWarning," +
" b.amounts_early_warning_status amountsEarlyWarningStatus," +
" a.create_time storeCreateTime" +
" from high_merchant_store a" +
" LEFT JOIN high_merchant_store_account b on b.store_id = a.id" +
" LEFT JOIN high_merchant c on c.id = a.merchant_id" +
" LEFT JOIN bs_company d on d.id = c.company_id" +
" where a.type = 1 and a.source_type = 1 and a.`status` <![CDATA[ <> ]]> 0" +
" <if test='param.companyId != null'> and d.id = #{param.companyId}</if> " +
" <if test='param.merId != null'> and c.id = #{param.merId}</if> " +
" <if test='param.gasName != null'> and a.store_name like concat('%', #{param.gasName} ,'%') </if> " +
" <if test='param.prestoreType != null'> and a.prestore_type = #{param.prestoreType}</if> " +
" <if test='param.amountsEarlyWarningStatus != null'> and b.amounts_early_warning_status = #{param.amountsEarlyWarningStatus}</if> " +
" ORDER BY amountsEarlyWarningStatus desc, storeCreateTime desc" +
"</script>"
})
List<GasSelfBuiltStationModel> selectGasSelfBuiltStationList(@Param("param") Map<String, Object> param);
}

@ -0,0 +1,150 @@
package com.hai.model;
import java.math.BigDecimal;
import java.util.Date;
/**
* 加油自建站模型
* @author hurui
*/
public class GasSelfBuiltStationModel {
private Long storeId;
private Long storeMerId;
private String storeMerName;
private Long companyId;
private String companyName;
private Long regionId;
private String regionName;
private String storeKey;
private String storeName;
private String storeAddress;
private Integer storePrestoreType;
private BigDecimal amounts;
private BigDecimal amountsEarlyWarning;
private Integer amountsEarlyWarningStatus;
private Date storeCreateTime;
public Long getStoreId() {
return storeId;
}
public void setStoreId(Long storeId) {
this.storeId = storeId;
}
public Long getStoreMerId() {
return storeMerId;
}
public void setStoreMerId(Long storeMerId) {
this.storeMerId = storeMerId;
}
public String getStoreMerName() {
return storeMerName;
}
public void setStoreMerName(String storeMerName) {
this.storeMerName = storeMerName;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public Long getRegionId() {
return regionId;
}
public void setRegionId(Long regionId) {
this.regionId = regionId;
}
public String getRegionName() {
return regionName;
}
public void setRegionName(String regionName) {
this.regionName = regionName;
}
public String getStoreKey() {
return storeKey;
}
public void setStoreKey(String storeKey) {
this.storeKey = storeKey;
}
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public String getStoreAddress() {
return storeAddress;
}
public void setStoreAddress(String storeAddress) {
this.storeAddress = storeAddress;
}
public Integer getStorePrestoreType() {
return storePrestoreType;
}
public void setStorePrestoreType(Integer storePrestoreType) {
this.storePrestoreType = storePrestoreType;
}
public BigDecimal getAmounts() {
return amounts;
}
public void setAmounts(BigDecimal amounts) {
this.amounts = amounts;
}
public BigDecimal getAmountsEarlyWarning() {
return amountsEarlyWarning;
}
public void setAmountsEarlyWarning(BigDecimal amountsEarlyWarning) {
this.amountsEarlyWarning = amountsEarlyWarning;
}
public Integer getAmountsEarlyWarningStatus() {
return amountsEarlyWarningStatus;
}
public void setAmountsEarlyWarningStatus(Integer amountsEarlyWarningStatus) {
this.amountsEarlyWarningStatus = amountsEarlyWarningStatus;
}
public Date getStoreCreateTime() {
return storeCreateTime;
}
public void setStoreCreateTime(Date storeCreateTime) {
this.storeCreateTime = storeCreateTime;
}
}

@ -2,6 +2,7 @@ package com.hai.service;
import com.github.pagehelper.PageInfo;
import com.hai.entity.HighMerchantStore;
import com.hai.model.GasSelfBuiltStationModel;
import com.hai.model.HighMerchantStoreModel;
import java.util.List;
@ -98,4 +99,10 @@ public interface HighMerchantStoreService {
**/
List<HighMerchantStore> getStoreListByLongitude(Map<String, Object> map);
/**
* 查询自建站 油站
* @param map
* @return
*/
List<GasSelfBuiltStationModel> getGasSelfBuiltStationList(Map<String, Object> map);
}

@ -9,6 +9,7 @@ import com.hai.common.utils.MD5Util;
import com.hai.config.SpPrinterConfig;
import com.hai.dao.HighMerchantStoreMapper;
import com.hai.entity.*;
import com.hai.model.GasSelfBuiltStationModel;
import com.hai.model.HighMerchantStoreModel;
import com.hai.service.HighMerchantStoreAccountService;
import com.hai.service.HighMerchantStoreService;
@ -239,5 +240,10 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService {
return collect;
}
@Override
public List<GasSelfBuiltStationModel> getGasSelfBuiltStationList(Map<String, Object> map) {
return highMerchantStoreMapper.selectGasSelfBuiltStationList(map);
}
}

@ -71,14 +71,16 @@ public class SecUserServiceImpl implements SecUserService {
organization.setManagerPhone(user.getTelephone());
bsOrganizationMapper.updateByPrimaryKey(organization);
}
for (Long labelId : user.getLabelIdArray()) {
String labelName = commonService.getDictionaryCodeName("USER_LABEL", labelId.toString());
if (labelName != null) {
SecUserLabel label = new SecUserLabel();
label.setUserId(user.getId());
label.setLabelId(labelId);
label.setLabelName(labelName);
userLabelService.edit(label);
if (user.getLabelIdArray() != null) {
for (Long labelId : user.getLabelIdArray()) {
String labelName = commonService.getDictionaryCodeName("USER_LABEL", labelId.toString());
if (labelName != null) {
SecUserLabel label = new SecUserLabel();
label.setUserId(user.getId());
label.setLabelId(labelId);
label.setLabelName(labelName);
userLabelService.edit(label);
}
}
}
}

Loading…
Cancel
Save