轮胎生命周期展示完善

master
杨万里 2 days ago
parent 7361dad99c
commit 0f29c27d20

@ -12,11 +12,7 @@ import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.domain.vo.BaseTyreVo;
import com.ruoyi.system.service.IBaseTyreService;
import com.ruoyi.system.service.IRecordCheckService;
import com.ruoyi.system.service.IRecordTyreInstallService;
import com.ruoyi.system.service.IRecordWarehousingService;
import com.ruoyi.system.service.ITyreStatDetailService;
import com.ruoyi.system.service.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
@ -57,7 +53,10 @@ public class BaseTyreController extends BaseController
//“库存盘点详情”对话框和“轮胎详情”页签
@Autowired
private ITyreStatDetailService tyreStatDetailService;
@Autowired
private IBizOrderTireDetailService bizOrderTireDetailService;
@Autowired
private IBizMaintenanceOrderService iBizMaintenanceOrderService;
@RequiresPermissions("tyre:tyre:view")
@GetMapping()
public String tyre()
@ -73,11 +72,8 @@ public class BaseTyreController extends BaseController
}
/**
*
*
*/
@GetMapping("/detail/{tyreId}")
public String tyreDetil(@PathVariable("tyreId") Long tyreId, Model model)
{
@ -117,15 +113,12 @@ public class BaseTyreController extends BaseController
timelineItem.setColor("primary"); // 蓝色,代表进入
timelineItem.setTime(item.getCreateTime());
}
timelineItem.setType("warehousing");
timelineItem.setDetail("仓库:" + "轮胎仓库"); // 如果有仓库名称字段,可以替换 "轮胎仓库"
timelineItems.add(timelineItem);
}
}
// --- 2.2 查询并转换安装记录 ---
RecordTyreInstall installQuery = new RecordTyreInstall();
installQuery.setTyreRfid(tyre.getTyreEpc());
@ -144,18 +137,27 @@ public class BaseTyreController extends BaseController
}
}
// --- 2.3 查询并转换检查记录 ---
RecordCheck checkQuery = new RecordCheck();
checkQuery.setTyreRfid(tyre.getTyreEpc());
List<RecordCheck> checkList = recordCheckService.selectRecordCheckList(checkQuery);
if (checkList != null) {
for (RecordCheck item : checkList) {
//保养记录
BizOrderTireDetail bizOrderTireDetail = new BizOrderTireDetail();
bizOrderTireDetail.setTireId(tyre.getTyreId());
List<BizOrderTireDetail> bizOrderTireDetailList = bizOrderTireDetailService.selectBizOrderTireDetailList(bizOrderTireDetail);
if (bizOrderTireDetailList != null) {
for (BizOrderTireDetail item : bizOrderTireDetailList) {
//查询质检单信息
Long orderID = item.getOrderId();
BizMaintenanceOrder bizMaintenanceOrder = iBizMaintenanceOrderService.selectBizMaintenanceOrderByOrderId(orderID);
TimelineItem timelineItem = new TimelineItem();
timelineItem.setId(item.getId());
timelineItem.setTitle("轮胎检查"+item.getCreateBy());
timelineItem.setId(item.getDetailId());
timelineItem.setTitle("轮胎检查保养"+item.getCreateBy());
timelineItem.setType("check");
// timelineItem.setDetail(buildCheckDetail(item));
timelineItem.setDetail("深度:" + "17.8mm");
timelineItem.setDetail("场站:" + bizMaintenanceOrder.getFactoryName()+
"|车牌:"+bizMaintenanceOrder.getPlateNumber()+
"|轮位:"+item.getPositionName()+
"|花纹深度:"+item.getTreadDepth()+
"|气压:"+item.getTirePress()+
"|备注:"+item.getRemark()
);
timelineItem.setTime(item.getCreateTime());
timelineItem.setIcon("fa-check-circle");
timelineItem.setColor("warning");
@ -300,6 +302,14 @@ public class BaseTyreController extends BaseController
return info;
}
/**
* PDA
* @param baseTyre
* @return
*/
@PostMapping("/setRfidBarcode")
@ResponseBody
public AjaxResult setRfidBarcode(@Validated BaseTyre baseTyre)
@ -490,5 +500,16 @@ public class BaseTyreController extends BaseController
// 库存盘点链路统一切到新版详情模板,保留旧模板文件给其他场景继续观察或回退。
return prefix + "/typreDetill2";
}
@PostMapping("/pdaQueryTyreTimeLine")
@ResponseBody
public AjaxResult pdaQueryTyreTimeLine(BaseTyre baseTyre)
{
try {
Map resultMap = baseTyreService.pdaQueryTyreTimeLine(baseTyre);
return success(resultMap);
}catch (Exception e){
e.printStackTrace();
return error();
}
}
}

@ -7,7 +7,7 @@ ruoyi:
# 版权年份
copyrightYear: 2026
# 实例演示开关
demoEnabled: false
demoEnabled: true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: C:/ruoyi/uploadPath
# 获取ip地址开关

@ -347,6 +347,8 @@ public class ShiroConfig
filterChainDefinitionMap.put("/tyre/order/PDAGetMaintenanceOrder", "anon,captchaValidate");
filterChainDefinitionMap.put("/tyre/order/PDAAddMaintenanceOrder", "anon,captchaValidate");
filterChainDefinitionMap.put("/tyre/order/PDASaveMaintenanceOrder", "anon,captchaValidate");
filterChainDefinitionMap.put("/tyre/tyre/pdaQueryTyreTimeLine", "anon,captchaValidate");
// 系统权限列表
// filterChainDefinitionMap.putAll(SpringUtils.getBean(IMenuService.class).selectPermsAll());

@ -52,6 +52,8 @@ public class BaseTyre extends BaseEntity
private String tyrePattern;
@Excel(name = "轮胎初始深度")
private String patternDepth;
@Excel(name = "标准气压")
private String pressure;
@Excel(name = "轮胎沟槽数")
private String grooves;
/** 轮胎类别 */
@ -74,6 +76,23 @@ public class BaseTyre extends BaseEntity
@Excel(name = "所在轮位")
private String wheelPostion;
public String getPressure() {
return pressure;
}
public void setPressure(String pressure) {
this.pressure = pressure;
}
private String keyParam;
public String getKeyParam() {
return keyParam;
}
public void setKeyParam(String keyParam) {
this.keyParam = keyParam;
}
public String getCompany() {
return company;

@ -24,8 +24,10 @@ public class BizOrderTireDetail extends BaseEntity
private Long orderId;
/** 轮胎位置ID关联位置表 */
@Excel(name = "轮胎位置ID", readConverterExp = "关=联位置表")
// @Excel(name = "轮胎位置ID", readConverterExp = "关=联位置表")
private Long positionId;
@Excel(name = "轮胎位置ID")
private String positionName;
/** 轮胎ID关联轮胎档案如果是新胎可能为空或临时生成 */
@Excel(name = "轮胎ID", readConverterExp = "关=联轮胎档案,如果是新胎可能为空或临时生成")
@ -49,6 +51,14 @@ public class BizOrderTireDetail extends BaseEntity
// 数据类型(保养;换新胎,卸车;换新胎,装车)
private String dataType;
public String getPositionName() {
return positionName;
}
public void setPositionName(String positionName) {
this.positionName = positionName;
}
public String getDataType() {
return dataType;
}

@ -72,4 +72,6 @@ public interface BaseTyreMapper
String getTeamByUser(String createBy);
List<Map> vTyreStockSummary(SysDept sysDept);
BaseTyre selectBaseTyreByKeyParam(BaseTyre baseTyre);
}

@ -75,4 +75,6 @@ public interface IBaseTyreService
String importBaseTyre(List<BaseTyreVo> baseTyreVoList, boolean updateSupport, String operName);
List<Map> vTyreStockSummary(SysDept sysDept);
Map pdaQueryTyreTimeLine(BaseTyre baseTyre);
}

@ -67,4 +67,5 @@ public interface IRecordTyreInstallService
AjaxResult PdaInstallTyre(RecordTyreInstall recordTyreInstall);
AjaxResult PdaUnInstallTyre(RecordTyreInstall recordTyreInstall);
}

@ -10,8 +10,12 @@ import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.BaseCar;
import com.ruoyi.system.domain.BaseTyre;
import com.ruoyi.system.domain.RecordTyreInstall;
import com.ruoyi.system.domain.RecordWarehousing;
import com.ruoyi.system.domain.vo.BaseTyreVo;
import com.ruoyi.system.mapper.BaseTyreMapper;
import com.ruoyi.system.mapper.RecordTyreInstallMapper;
import com.ruoyi.system.mapper.RecordWarehousingMapper;
import com.ruoyi.system.service.IBaseTyreService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -19,6 +23,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -35,6 +40,12 @@ public class BaseTyreServiceImpl implements IBaseTyreService
{
@Autowired
private BaseTyreMapper baseTyreMapper;
@Autowired
private RecordWarehousingMapper recordWarehousingMapper;
@Autowired
private RecordTyreInstallMapper recordTyreInstallMapper;
private static final Logger log = LoggerFactory.getLogger(BaseTyreServiceImpl.class);
/**
*
@ -213,4 +224,28 @@ public class BaseTyreServiceImpl implements IBaseTyreService
List<Map> mapList = baseTyreMapper.vTyreStockSummary(sysDept);
return mapList;
}
@Override
public Map pdaQueryTyreTimeLine(BaseTyre baseTyre) {
Map map = new HashMap();
//查询轮胎数据
BaseTyre resultBase = baseTyreMapper.selectBaseTyreByKeyParam(baseTyre);
if (resultBase==null){
return map;
}else {
map.put("resultBase",resultBase);
//查询出入库数据
String tyreRfid = resultBase.getTyreEpc();
RecordWarehousing recordWarehousing = new RecordWarehousing();
recordWarehousing.setTyreRfid(tyreRfid);
List<RecordWarehousing> recordWarehousingList = recordWarehousingMapper.selectRecordWarehousingList(recordWarehousing);
map.put("recordWarehousingList",recordWarehousingList);
//查询操作记录记录(装卸车)
RecordTyreInstall recordTyreInstall = new RecordTyreInstall();
recordTyreInstall.setTyreRfid(tyreRfid);
List<RecordTyreInstall> recordTyreInstallList = recordTyreInstallMapper.selectRecordTyreInstallList(recordTyreInstall);
map.put("recordTyreInstallList",recordTyreInstallList);
return map;
}
}
}

@ -179,6 +179,8 @@ public class RecordTyreInstallServiceImpl implements IRecordTyreInstallService
}
return AjaxResult.error("卸胎失败!");
}
public static long calculateMileageDifference(long endMileage, long startMileage) {
return Math.abs(endMileage - startMileage);
}

@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="tyreModel" column="tyre_model" />
<result property="tyreLevel" column="tyre_level" />
<result property="tyrePattern" column="tyre_pattern" />
<result property="pressure" column="pressure" />
<result property="tyreType" column="tyre_type" />
<result property="team" column="team" />
<result property="deptName" column="dept_name" />
@ -126,6 +127,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
${params.dataScope}
</where>
</select>
<select id="selectBaseTyreByKeyParam" resultMap="BaseTyreResult" parameterType="BaseTyre">
SELECT
tyre_id,
tyre_no,
self_no,
tyre_epc,
tyre_brand,
tyre_model,
tyre_level,
tyre_pattern,
pattern_depth,
tyre_type,
sdss.dept_name as company,
d.team,
sd.dept_name as carTeam,
su.user_name AS create_by,
d.create_time,
d.update_by,
d.update_time,
d.remark,
d.car_no,
wheel_postion,
d.pressure
FROM
base_tyre d
LEFT JOIN sys_user su ON su.login_name = d.create_by
LEFT JOIN base_car bc ON bc.car_no = d.car_no
LEFT JOIN sys_dept sd ON bc.dept_id = sd.dept_id
LEFT JOIN sys_dept sds ON sd.parent_id = sds.dept_id
LEFT JOIN sys_dept sdss ON sds.parent_id = sdss.dept_id
where tyre_id is not null
<if test="keyParam != null and keyParam != ''">and d.tyre_epc = #{keyParam} OR d.tyre_no = #{keyParam} OR d.self_no = #{keyParam}</if>
</select>
<insert id="insertBaseTyre" parameterType="BaseTyre">

@ -111,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN sys_user su ON su.login_name = bmo.create_by
LEFT JOIN sys_user sus ON sus.login_name = bmo.update_by
LEFT JOIN base_car bc ON bc.id = bmo.vehicle_id
where order_id = #{orderId}
</select>
<select id="selectBizMaintenanceOrderTD" resultMap="BizMaintenanceOrderResult">

@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="positionName" column="position_name" />
</resultMap>
<sql id="selectBizOrderTireDetailVo">
@ -25,15 +26,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectBizOrderTireDetailList" parameterType="BizOrderTireDetail" resultMap="BizOrderTireDetailResult">
<include refid="selectBizOrderTireDetailVo"/>
select botd.detail_id, botd.order_id, botd.position_id, botd.tire_id, botd.tire_code, botd.tread_depth,
botd.tire_press, botd.tire_status, botd.create_by, botd.create_time, botd.update_by, botd.update_time, botd.remark,
sda.dict_label as position_name
from biz_order_tire_detail botd
LEFT JOIN sys_dict_data sda ON sda.dict_value = botd.position_id
<where>
<if test="orderId != null "> and order_id = #{orderId}</if>
<if test="positionId != null "> and position_id = #{positionId}</if>
<if test="tireId != null "> and tire_id = #{tireId}</if>
<if test="tireCode != null and tireCode != ''"> and tire_code = #{tireCode}</if>
<if test="treadDepth != null "> and tread_depth = #{treadDepth}</if>
<if test="tirePress != null "> and tire_press = #{tirePress}</if>
<if test="tireStatus != null and tireStatus != ''"> and tire_status = #{tireStatus}</if>
<if test="orderId != null "> and botd.order_id = #{orderId}</if>
<if test="positionId != null "> and botd.position_id = #{positionId}</if>
<if test="tireId != null "> and botd.tire_id = #{tireId}</if>
<if test="tireCode != null and tireCode != ''"> and botd.tire_code = #{tireCode}</if>
<if test="treadDepth != null "> and botd.tread_depth = #{treadDepth}</if>
<if test="tirePress != null "> and botd.tire_press = #{tirePress}</if>
<if test="tireStatus != null and tireStatus != ''"> and botd.tire_status = #{tireStatus}</if>
</where>
</select>

Loading…
Cancel
Save