This commit is contained in:
sxu 2023-12-10 01:49:38 +08:00
parent 86c58c72c4
commit bbaac6afd4
4 changed files with 55 additions and 1 deletions

View File

@ -84,4 +84,18 @@ public class OrderInfoVo extends OrderInfo {
private String contractUrl;
@ApiModelProperty(value = "订单状态文字")
private String orderStatusStr;
@ApiModelProperty(value = "设备进场省ID")
private Integer provinceId;
@ApiModelProperty(value = "设备进场市ID")
private Integer cityId;
@ApiModelProperty(value = "设备进场区ID")
private Integer areaId;
@ApiModelProperty(value = "省份名称")
private String provinceStr;
@ApiModelProperty(value = "市名称")
private String cityStr;
@ApiModelProperty(value = "区名称")
private String areaStr;
@ApiModelProperty(value = "工期时长包括单位")
private String durationStr;
}

View File

@ -4,6 +4,7 @@ import java.util.List;
import com.bonus.zlpt.common.core.domain.order.OrderInfo;
import com.bonus.zlpt.common.core.domain.order.vo.OrderInfoVo;
import com.bonus.zlpt.equip.api.domain.vo.DevInfoVo;
import com.bonus.zlpt.system.api.domain.BaseAddress;
/**
* 订单信息Mapper接口
@ -70,4 +71,8 @@ public interface OrderInfoMapper
public long count(Long userId);
public DevInfoVo getDevInfoVo(Long maId);
public List<BaseAddress> getBaseAddress();
public BaseAddress getBaseAddressByCode(String code);
}

View File

@ -11,6 +11,7 @@ import com.bonus.zlpt.common.core.utils.uuid.UUID;
import com.bonus.zlpt.common.security.utils.SecurityUtils;
import com.bonus.zlpt.equip.api.domain.vo.DevInfoVo;
import com.bonus.zlpt.order.mapper.OrderDetailsMapper;
import com.bonus.zlpt.system.api.domain.BaseAddress;
import com.bonus.zlpt.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -30,6 +31,7 @@ import javax.annotation.Resource;
public class OrderInfoServiceImpl implements IOrderInfoService
{
private final Integer ORDER_ATTACHMENT_DIC_ID = 21;
private final String ORDER_STATUS_INIT = "31";
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@Resource
private OrderInfoMapper orderInfoMapper;
@ -45,7 +47,22 @@ public class OrderInfoServiceImpl implements IOrderInfoService
@Override
public OrderInfoVo selectOrderInfoByOrderId(Long orderId)
{
return orderInfoMapper.selectOrderInfoByOrderId(orderId);
OrderInfoVo orderInfoVo = orderInfoMapper.selectOrderInfoByOrderId(orderId);
List<BaseAddress> addressList = orderInfoMapper.getBaseAddress();
for (BaseAddress address : addressList) {
if (address.getCode().equals(String.valueOf(orderInfoVo.getProvinceId()))) {
orderInfoVo.setProvinceStr(address.getName());
}
if (address.getCode().equals(String.valueOf(orderInfoVo.getCityId()))) {
orderInfoVo.setCityStr(address.getName());
}
if (address.getCode().equals(String.valueOf(orderInfoVo.getAreaId()))) {
orderInfoVo.setAreaStr(address.getName());
}
}
//时长+单位
orderInfoVo.setDurationStr(orderInfoVo.getDuration()+orderInfoVo.getDurationType());
return orderInfoVo;
}
/**
@ -74,6 +91,7 @@ public class OrderInfoServiceImpl implements IOrderInfoService
orderInfo.setTime(dateFormat.format(new Date()));
DevInfoVo devInfoVo = orderInfoMapper.getDevInfoVo(orderInfo.getMaId());
orderInfo.setSupplier(String.valueOf(devInfoVo.getOwnCo()));
orderInfo.setOrderStatus(ORDER_STATUS_INIT);
orderInfoMapper.insertOrderInfo(orderInfo);
Long orderId = orderInfoMapper.selectLastInsertId();
orderInfo.setOrderId(orderId);

View File

@ -92,6 +92,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planStartTime != null">plan_start_time,</if>
<if test="isMachinist != null">is_machinist,</if>
<if test="addressId != null">address_id,</if>
<if test="provinceId != null">province_id,</if>
<if test="cityId != null">city_id,</if>
<if test="areaId != null">area_id,</if>
<if test="address != null">address,</if>
<if test="duration != null">duration,</if>
<if test="durationType != null">duration_type,</if>
@ -116,6 +119,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planStartTime != null">#{planStartTime},</if>
<if test="isMachinist != null">#{isMachinist},</if>
<if test="addressId != null">#{addressId},</if>
<if test="provinceId != null">#{provinceId},</if>
<if test="cityId != null">#{cityId},</if>
<if test="areaId != null">#{areaId},</if>
<if test="address != null">#{address},</if>
<if test="duration != null">#{duration},</if>
<if test="durationType != null">#{durationType},</if>
@ -164,6 +170,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planStartTime != null">plan_start_time = #{planStartTime},</if>
<if test="isMachinist != null">is_machinist = #{isMachinist},</if>
<if test="addressId != null">address_id = #{addressId},</if>
<if test="provinceId != null">address_id = #{provinceId},</if>
<if test="cityId != null">city_id = #{cityId},</if>
<if test="areaId != null">area_id = #{areaId},</if>
<if test="address != null">address = #{address},</if>
<if test="duration != null">duration = #{duration},</if>
<if test="durationType != null">duration_type = #{durationType},</if>
@ -209,4 +218,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from ma_dev_info d
where d.ma_id = #{maId}
</select>
<select id="getBaseAddress" resultType="com.bonus.zlpt.system.api.domain.BaseAddress">
select id,name,code from base_address where status = 1
</select>
<select id="getBaseAddressByCode" resultType="com.bonus.zlpt.system.api.domain.BaseAddress">
select id,name,code from base_address where status = 1 and code = #{code}
</select>
</mapper>