无关风月
2024-12-31 bf765893039bc7968b8160a70bda778526dca98c
manage/src/main/java/com/jilongda/manage/controller/TOrderAftersalesController.java
@@ -5,6 +5,7 @@
import com.jilongda.common.basic.PageInfo;
import com.jilongda.common.constants.WarehousingConstant;
import com.jilongda.common.utils.CodeGenerateUtils;
import com.jilongda.common.utils.TimeUtils;
import com.jilongda.manage.authority.model.SecUser;
import com.jilongda.manage.authority.service.SecUserService;
import com.jilongda.manage.model.*;
@@ -16,6 +17,7 @@
import com.jilongda.manage.vo.TOrderAftersalesVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
@@ -74,26 +76,30 @@
    @ApiOperation(value = "订单售后详情")
    @GetMapping(value = "/detail")
    public ApiResult<TOrderAftersalesDetailVO> detail(Integer id) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
        TOrderAftersales byId = orderAftersalesService.getById(id);
        TOrder byId1 = orderService.getById(byId.getOrderId());
        TStore byId2 = tStoreService.getById(byId1.getStoreId());
        SecUser byId3 = secUserService.getById(byId.getSysId());
        TOptometrist byId5 = tOptometristService.getById(byId.getOptometristId());
        TOrderAftersalesDetailVO res = new TOrderAftersalesDetailVO();
        BeanUtils.copyProperties(byId,res);
        res.setOrderId(byId1.getId());
        if (byId1.getUserId()!=null){
            TAppUser byId4 = appUserService.getById(byId1);
            TAppUser byId4 = appUserService.getById(byId1.getUserId());
            if (byId4!=null){
                res.setPhone(byId4.getPhone());
                res.setName(byId4.getName());
                res.setRealName(byId4.getRealName());
            }
        }else{
            res.setPhone(byId1.getPhone());
            res.setRealName(byId1.getRealName());
        }
        res.setStoreName(byId2.getName());
        res.setOptometristName(byId5.getName());
        res.setSalesUser(byId3.getNickName());
        res.setOrderTime(simpleDateFormat.format(byId1.getCreateTime()));
        res.setAfterSalesTime(simpleDateFormat1.format(byId.getCreateTime()));
        res.setOrderTime(TimeUtils.localDateTimeToString(byId1.getCreateTime()));
        res.setAfterSalesTime(TimeUtils.localDateTimeToString(byId.getCreateTime()));
        List<TOrderGoods> list = goodsService.lambdaQuery().eq(TOrderGoods::getOrderId, byId1.getId()).list();
        res.setGoodsList(list);
        res.setOrderMoney(byId1.getOrderMoney());