修正getCompanyId
This commit is contained in:
parent
aeeec68232
commit
225fe39491
|
|
@ -1,6 +1,7 @@
|
||||||
package com.bonus.material.basic.controller;
|
package com.bonus.material.basic.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
|
@ -46,7 +47,7 @@ public class BmCompanyAddressController extends BaseController {
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(BmCompanyAddress bmCompanyAddress) {
|
public TableDataInfo list(BmCompanyAddress bmCompanyAddress) {
|
||||||
startPage();
|
startPage();
|
||||||
bmCompanyAddress.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
bmCompanyAddress.setCompanyId(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId()).orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()));
|
||||||
List<BmCompanyAddress> list = bmCompanyAddressService.selectBmCompanyAddressList(bmCompanyAddress);
|
List<BmCompanyAddress> list = bmCompanyAddressService.selectBmCompanyAddressList(bmCompanyAddress);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
@ -85,7 +86,6 @@ public class BmCompanyAddressController extends BaseController {
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody BmCompanyAddress bmCompanyAddress) {
|
public AjaxResult add(@RequestBody BmCompanyAddress bmCompanyAddress) {
|
||||||
try {
|
try {
|
||||||
bmCompanyAddress.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
|
||||||
return toAjax(bmCompanyAddressService.insertBmCompanyAddress(bmCompanyAddress));
|
return toAjax(bmCompanyAddressService.insertBmCompanyAddress(bmCompanyAddress));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return error("系统错误, " + e.getMessage());
|
return error("系统错误, " + e.getMessage());
|
||||||
|
|
@ -105,7 +105,7 @@ public class BmCompanyAddressController extends BaseController {
|
||||||
return error("ID不能为空");
|
return error("ID不能为空");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
bmCompanyAddress.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
bmCompanyAddress.setCompanyId(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId()).orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()));
|
||||||
return toAjax(bmCompanyAddressService.updateBmCompanyAddress(bmCompanyAddress));
|
return toAjax(bmCompanyAddressService.updateBmCompanyAddress(bmCompanyAddress));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return error("系统错误, " + e.getMessage());
|
return error("系统错误, " + e.getMessage());
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
package com.bonus.material.basic.service.impl;
|
package com.bonus.material.basic.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.material.basic.mapper.BmCompanyAddressMapper;
|
import com.bonus.material.basic.mapper.BmCompanyAddressMapper;
|
||||||
|
|
@ -50,6 +53,8 @@ public class BmCompanyAddressServiceImpl implements IBmCompanyAddressService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertBmCompanyAddress(BmCompanyAddress bmCompanyAddress) {
|
public int insertBmCompanyAddress(BmCompanyAddress bmCompanyAddress) {
|
||||||
|
bmCompanyAddress.setCompanyId(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId())
|
||||||
|
.orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()));
|
||||||
bmCompanyAddress.setCreateTime(DateUtils.getNowDate());
|
bmCompanyAddress.setCreateTime(DateUtils.getNowDate());
|
||||||
try {
|
try {
|
||||||
return bmCompanyAddressMapper.insertBmCompanyAddress(bmCompanyAddress);
|
return bmCompanyAddressMapper.insertBmCompanyAddress(bmCompanyAddress);
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,8 @@ public class BmMessageServiceImpl implements IBmMessageService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<BmMessage> selectBmMessageList(BmMessage bmMessage) {
|
public List<BmMessage> selectBmMessageList(BmMessage bmMessage) {
|
||||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
Long companyId = Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId())
|
||||||
|
.orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId());
|
||||||
bmMessage.setFromCompany(companyId);
|
bmMessage.setFromCompany(companyId);
|
||||||
bmMessage.setToCompany(companyId);
|
bmMessage.setToCompany(companyId);
|
||||||
List<BmMessage> messages = bmMessageMapper.selectBmMessageList(bmMessage);
|
List<BmMessage> messages = bmMessageMapper.selectBmMessageList(bmMessage);
|
||||||
|
|
@ -56,7 +57,8 @@ public class BmMessageServiceImpl implements IBmMessageService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BmMessage> selectBmMessageListOne(BmMessage bmMessage) {
|
public List<BmMessage> selectBmMessageListOne(BmMessage bmMessage) {
|
||||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
Long companyId = Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId())
|
||||||
|
.orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId());
|
||||||
bmMessage.setFromCompany(bmMessage.getFromCompany());
|
bmMessage.setFromCompany(bmMessage.getFromCompany());
|
||||||
bmMessage.setToCompany(companyId);
|
bmMessage.setToCompany(companyId);
|
||||||
List<BmMessage> messages = bmMessageMapper.selectBmMessageListOne(bmMessage);
|
List<BmMessage> messages = bmMessageMapper.selectBmMessageListOne(bmMessage);
|
||||||
|
|
@ -65,7 +67,8 @@ public class BmMessageServiceImpl implements IBmMessageService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BmMessage> selectBmMessageListFromCache(BmMessage bmMessage) {
|
public List<BmMessage> selectBmMessageListFromCache(BmMessage bmMessage) {
|
||||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
Long companyId = Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId())
|
||||||
|
.orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId());
|
||||||
RedisService redisService = SpringUtils.getBean(RedisService.class);
|
RedisService redisService = SpringUtils.getBean(RedisService.class);
|
||||||
|
|
||||||
// 获取所有消息缓存 key
|
// 获取所有消息缓存 key
|
||||||
|
|
@ -102,7 +105,8 @@ public class BmMessageServiceImpl implements IBmMessageService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BmMessage> selectBmMessageListFromCacheOne(BmMessage bmMessage) {
|
public List<BmMessage> selectBmMessageListFromCacheOne(BmMessage bmMessage) {
|
||||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
Long companyId = Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId())
|
||||||
|
.orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId());
|
||||||
Long toCompany = bmMessage.getToCompany();
|
Long toCompany = bmMessage.getToCompany();
|
||||||
|
|
||||||
RedisService redisService = SpringUtils.getBean(RedisService.class);
|
RedisService redisService = SpringUtils.getBean(RedisService.class);
|
||||||
|
|
@ -152,7 +156,8 @@ public class BmMessageServiceImpl implements IBmMessageService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BmMessage getNoReadNum(BmMessage bmMessage) {
|
public BmMessage getNoReadNum(BmMessage bmMessage) {
|
||||||
bmMessage.setToCompany(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
bmMessage.setToCompany(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId())
|
||||||
|
.orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()));
|
||||||
return bmMessageMapper.getNoReadNum(bmMessage);
|
return bmMessageMapper.getNoReadNum(bmMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -166,7 +171,8 @@ public class BmMessageServiceImpl implements IBmMessageService {
|
||||||
public int insertBmMessage(BmMessage bmMessage) {
|
public int insertBmMessage(BmMessage bmMessage) {
|
||||||
bmMessage.setCreateTime(DateUtils.getNowDate());
|
bmMessage.setCreateTime(DateUtils.getNowDate());
|
||||||
try {
|
try {
|
||||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
Long companyId = Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId())
|
||||||
|
.orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId());
|
||||||
bmMessage.setFromCompany(companyId);
|
bmMessage.setFromCompany(companyId);
|
||||||
bmMessage.setFromUser(SecurityUtils.getLoginUser().getSysUser().getUserId());
|
bmMessage.setFromUser(SecurityUtils.getLoginUser().getSysUser().getUserId());
|
||||||
bmMessage.setUuid(String.valueOf(UUID.randomUUID()));
|
bmMessage.setUuid(String.valueOf(UUID.randomUUID()));
|
||||||
|
|
@ -200,7 +206,8 @@ public class BmMessageServiceImpl implements IBmMessageService {
|
||||||
try {
|
try {
|
||||||
bmMessageMapper.updateBmMessage(bmMessage);
|
bmMessageMapper.updateBmMessage(bmMessage);
|
||||||
//Redis
|
//Redis
|
||||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
Long companyId = Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId())
|
||||||
|
.orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId());
|
||||||
Collection<String> keys1 = SpringUtils.getBean(RedisService.class).keys(MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE + bmMessage.getFromCompany() + ":" + companyId);
|
Collection<String> keys1 = SpringUtils.getBean(RedisService.class).keys(MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE + bmMessage.getFromCompany() + ":" + companyId);
|
||||||
Collection<String> keys2 = SpringUtils.getBean(RedisService.class).keys(MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE + companyId + ":" + bmMessage.getToCompany());
|
Collection<String> keys2 = SpringUtils.getBean(RedisService.class).keys(MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE + companyId + ":" + bmMessage.getToCompany());
|
||||||
List<String> keys = new ArrayList<>();
|
List<String> keys = new ArrayList<>();
|
||||||
|
|
@ -222,7 +229,8 @@ public class BmMessageServiceImpl implements IBmMessageService {
|
||||||
public int updateBmMessageAll(BmMessage bmMessage) {
|
public int updateBmMessageAll(BmMessage bmMessage) {
|
||||||
bmMessage.setIsRead(1);
|
bmMessage.setIsRead(1);
|
||||||
bmMessage.setUpdateTime(DateUtils.getNowDate());
|
bmMessage.setUpdateTime(DateUtils.getNowDate());
|
||||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
Long companyId = Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId())
|
||||||
|
.orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId());
|
||||||
bmMessage.setToCompany(companyId);
|
bmMessage.setToCompany(companyId);
|
||||||
for (Long fromCompany : bmMessage.getFromCompanys()) {
|
for (Long fromCompany : bmMessage.getFromCompanys()) {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
@ -24,7 +25,8 @@ public class ToDoServiceImpl implements ToDoService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ToDoBean> getToDoList(ToDoBean bean) {
|
public List<ToDoBean> getToDoList(ToDoBean bean) {
|
||||||
bean.setNoticeCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
bean.setNoticeCompanyId(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId())
|
||||||
|
.orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()));
|
||||||
return toDoMapper.getToDoList(bean);
|
return toDoMapper.getToDoList(bean);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -717,7 +717,7 @@ public class DevInfoServiceImpl implements DevInfoService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<DevInfoVo> selectDevInfoLists(DevInfoVo devInfo) {
|
public List<DevInfoVo> selectDevInfoLists(DevInfoVo devInfo) {
|
||||||
devInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString());
|
devInfo.setCompanyId(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId()).orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()).toString());
|
||||||
List<DevInfoVo> list = devInfoMapper.selectDevInfoLists(devInfo);
|
List<DevInfoVo> list = devInfoMapper.selectDevInfoLists(devInfo);
|
||||||
if (!CollectionUtils.isEmpty(list)) {
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
for (DevInfoVo infoVo : list) {
|
for (DevInfoVo infoVo : list) {
|
||||||
|
|
@ -828,7 +828,7 @@ public class DevInfoServiceImpl implements DevInfoService {
|
||||||
devInfo.setCode(getString());
|
devInfo.setCode(getString());
|
||||||
DevInfo devInfo1 = new DevInfo();
|
DevInfo devInfo1 = new DevInfo();
|
||||||
BeanUtils.copyProperties(devInfo, devInfo1);
|
BeanUtils.copyProperties(devInfo, devInfo1);
|
||||||
devInfo1.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString());
|
devInfo1.setCompanyId(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId()).orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()).toString());
|
||||||
devInfo1.setMaStatus(0);
|
devInfo1.setMaStatus(0);
|
||||||
devInfoMapper.insertDevInfo(devInfo1);
|
devInfoMapper.insertDevInfo(devInfo1);
|
||||||
successNum++;
|
successNum++;
|
||||||
|
|
@ -878,13 +878,13 @@ public class DevInfoServiceImpl implements DevInfoService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DevInfoVo> selectAssociationList(DevInfoVo devInfo) {
|
public List<DevInfoVo> selectAssociationList(DevInfoVo devInfo) {
|
||||||
devInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString());
|
devInfo.setCompanyId(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId()).orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()).toString());
|
||||||
return devInfoMapper.selectAssociationList(devInfo);
|
return devInfoMapper.selectAssociationList(devInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DevInfoVo> getTagDevList(DevInfoVo devInfoVo) {
|
public List<DevInfoVo> getTagDevList(DevInfoVo devInfoVo) {
|
||||||
devInfoVo.setOwnCo(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
devInfoVo.setOwnCo(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId()).orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()));
|
||||||
return devInfoMapper.getTagDevList(devInfoVo);
|
return devInfoMapper.getTagDevList(devInfoVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import javax.annotation.Resource;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ma_sh
|
* @Author ma_sh
|
||||||
|
|
@ -64,7 +65,7 @@ public class MaDevQcServiceImpl implements MaDevQcService {
|
||||||
maDevQc.setQcCode(code);
|
maDevQc.setQcCode(code);
|
||||||
maDevQc.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
|
maDevQc.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
|
||||||
maDevQc.setCreateTime(DateUtils.getNowDate());
|
maDevQc.setCreateTime(DateUtils.getNowDate());
|
||||||
maDevQc.setQcCom(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString());
|
maDevQc.setQcCom(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId()).orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()).toString());
|
||||||
int result = maDevQcMapper.insertDevQc(maDevQc);
|
int result = maDevQcMapper.insertDevQc(maDevQc);
|
||||||
devInfoMapper.updateDevInfoIsQc(maDevQc);
|
devInfoMapper.updateDevInfoIsQc(maDevQc);
|
||||||
if (result > 0 && maDevQc.getId() != null) {
|
if (result > 0 && maDevQc.getId() != null) {
|
||||||
|
|
@ -93,7 +94,7 @@ public class MaDevQcServiceImpl implements MaDevQcService {
|
||||||
maDevQc.setQcCode(code);
|
maDevQc.setQcCode(code);
|
||||||
maDevQc.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
|
maDevQc.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
|
||||||
maDevQc.setCreateTime(DateUtils.getNowDate());
|
maDevQc.setCreateTime(DateUtils.getNowDate());
|
||||||
maDevQc.setQcCom(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString());
|
maDevQc.setQcCom(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId()).orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()).toString());
|
||||||
int result = maDevQcMapper.insertDevQc(maDevQc);
|
int result = maDevQcMapper.insertDevQc(maDevQc);
|
||||||
devInfoMapper.updateDevInfoIsQc(maDevQc);
|
devInfoMapper.updateDevInfoIsQc(maDevQc);
|
||||||
if (result > 0 && maDevQc.getId() != null) {
|
if (result > 0 && maDevQc.getId() != null) {
|
||||||
|
|
|
||||||
|
|
@ -425,7 +425,7 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
||||||
String str = dept.getDeptName().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
|
String str = dept.getDeptName().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
|
||||||
dept.setDeptName(str);
|
dept.setDeptName(str);
|
||||||
}
|
}
|
||||||
dept.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
dept.setCompanyId(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId()).orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()));
|
||||||
return mapper.selectDeptList(dept);
|
return mapper.selectDeptList(dept);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ public class OrderServiceImpl implements OrderService {
|
||||||
|
|
||||||
Long userid = SecurityUtils.getLoginUser().getUserid();
|
Long userid = SecurityUtils.getLoginUser().getUserid();
|
||||||
orderInfoDto.setBuyerId(userid.intValue());
|
orderInfoDto.setBuyerId(userid.intValue());
|
||||||
orderInfoDto.setBuyerCompany(SecurityUtils.getLoginUser().getSysUser().getCompanyId().intValue());
|
orderInfoDto.setBuyerCompany(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId()).orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()).intValue());
|
||||||
orderInfoDto.setCreater(userid);
|
orderInfoDto.setCreater(userid);
|
||||||
Integer i = orderMapper.insertOrderInfo(orderInfoDto);
|
Integer i = orderMapper.insertOrderInfo(orderInfoDto);
|
||||||
j += i;
|
j += i;
|
||||||
|
|
@ -159,7 +159,7 @@ public class OrderServiceImpl implements OrderService {
|
||||||
tmTask.setCode(code);
|
tmTask.setCode(code);
|
||||||
tmTask.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
tmTask.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||||
tmTask.setCreateTime(DateUtils.getNowDate());
|
tmTask.setCreateTime(DateUtils.getNowDate());
|
||||||
tmTask.setBuyerCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
tmTask.setBuyerCompanyId(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId()).orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()));
|
||||||
if (!CollectionUtils.isEmpty(orderDetailDtos)) {
|
if (!CollectionUtils.isEmpty(orderDetailDtos)) {
|
||||||
DevInfoVo devInfoVo = devInfoMapper.selectDevInfoByMaId(Long.valueOf(orderDetailDtos.get(0).getMaId()));
|
DevInfoVo devInfoVo = devInfoMapper.selectDevInfoByMaId(Long.valueOf(orderDetailDtos.get(0).getMaId()));
|
||||||
tmTask.setSellerCompanyId(Long.valueOf(devInfoVo.getCompanyId()));
|
tmTask.setSellerCompanyId(Long.valueOf(devInfoVo.getCompanyId()));
|
||||||
|
|
@ -173,9 +173,9 @@ public class OrderServiceImpl implements OrderService {
|
||||||
@Override
|
@Override
|
||||||
public List<OrderInfoDto> getOrderDetails(OrderInfoDto orderInfoDto) throws Exception {
|
public List<OrderInfoDto> getOrderDetails(OrderInfoDto orderInfoDto) throws Exception {
|
||||||
if (orderInfoDto.isFlag()) {
|
if (orderInfoDto.isFlag()) {
|
||||||
orderInfoDto.setSellerCompany(SecurityUtils.getLoginUser().getSysUser().getCompanyId().intValue());
|
orderInfoDto.setSellerCompany(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId()).orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()).intValue());
|
||||||
} else {
|
} else {
|
||||||
orderInfoDto.setBuyerCompany(SecurityUtils.getLoginUser().getSysUser().getCompanyId().intValue());
|
orderInfoDto.setBuyerCompany(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId()).orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()).intValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
List<OrderInfoDto> orderInfoDtos = orderMapper.getOrderDetails(orderInfoDto);
|
List<OrderInfoDto> orderInfoDtos = orderMapper.getOrderDetails(orderInfoDto);
|
||||||
|
|
@ -337,9 +337,9 @@ public class OrderServiceImpl implements OrderService {
|
||||||
public List<OrderInfoDto> getOrderStatusCount(OrderDetailDto dto) throws Exception {
|
public List<OrderInfoDto> getOrderStatusCount(OrderDetailDto dto) throws Exception {
|
||||||
//true:出租方 false:承租方
|
//true:出租方 false:承租方
|
||||||
if (dto.isFlag()) {
|
if (dto.isFlag()) {
|
||||||
dto.setSellerCompany(SecurityUtils.getLoginUser().getSysUser().getCompanyId().intValue());
|
dto.setSellerCompany(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId()).orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()).intValue());
|
||||||
} else {
|
} else {
|
||||||
dto.setBuyerCompany(SecurityUtils.getLoginUser().getSysUser().getCompanyId().intValue());
|
dto.setBuyerCompany(Optional.ofNullable(SecurityUtils.getLoginUser().getSysUser().getCompanyId()).orElse(SecurityUtils.getLoginUser().getSysUser().getDeptId()).intValue());
|
||||||
}
|
}
|
||||||
List<OrderInfoDto> orderInfoDto = orderMapper.getOrderStatusCount(dto);
|
List<OrderInfoDto> orderInfoDto = orderMapper.getOrderStatusCount(dto);
|
||||||
int total = 0;
|
int total = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue