修改 巡检接口

master
wanghao 2 months ago
parent e512f702d3
commit 26e38e002f

@ -173,7 +173,6 @@ public class ApiController {
private IRecordInvalidatedService recordInvalidatedService;
@PostMapping("/xj/selectLite")
public String xjSelectLite(String user) {
List<StockDto> list = apiService.xjSelect(user);
@ -186,13 +185,21 @@ public class ApiController {
@Autowired
private IRecordInspectionService inspectionService;
@PostMapping("/inspection/skipTask")
public AjaxResult inspectionSubmit(long tableId, String remark) {
apiService.updataInspectionTaskByObjid(tableId,remark,"跳过");
return success();
}
@PostMapping("/xj/submit")
public AjaxResult inspectionSubmit(long tableId, String json, long inspectionId, String user,List<MultipartFile> files) {
public AjaxResult inspectionSubmit(long tableId, String json, long inspectionId, String user, List<MultipartFile> files) {
//插入 info 表
List<StockDto> list = JSONObject.parseArray(json, StockDto.class);
String locationCode = list.get(0).getLocationCode();
apiService.deleteInspectionInfo(locationCode, inspectionId);
apiService.insertInspectionInfo(list, inspectionId);
//修改task状态
apiService.updataInspectionTaskByObjid(tableId);
apiService.updataInspectionTaskByObjid(tableId,null,"已完成");
//存储图片,插库
String filePath = RuoYiConfig.getUploadPath() + "/inspection";
@ -205,7 +212,8 @@ public class ApiController {
e.printStackTrace();
}
System.out.println("上传图片路径:" + pathName);
apiService.insertInspetionPictrue(inspectionId, tableId,user, pathName);
apiService.insertInspetionPictrue(inspectionId, tableId, user, pathName, locationCode);
}
}
@ -213,20 +221,6 @@ public class ApiController {
}
/**
*
*
* @param user
* @return
*/
@PostMapping("/inspection/selectTask")
public AjaxResult inspectionSelectTask(String user) {
List<CheckTaskInfo> list = apiService.inspectionSelectTask(user);
if (list == null || list.isEmpty()) {
return error("需要创建");
}
return success(list);
}
/**
*
@ -263,17 +257,37 @@ public class ApiController {
}
/**
*
*
* @return
*/
@PostMapping("/inspection/selectTask")
public AjaxResult inspectionSelectTask(@RequestParam(value = "state", defaultValue = "") String state) {
try {
int inspectionid = apiService.selectCodeFromRecode();
System.out.println(inspectionid + "-" + state);
List<CheckTaskInfo> list = apiService.inspectionSelectTask(state, inspectionid);
// if (list == null || list.isEmpty()) {
// return error("需要领用轮挡到机位");
// }
return success(list);
} catch (Exception e) {
e.printStackTrace();
return error("需要创建");
}
}
/**
*
*
* @param epc
* @param user
* @param remark
* @return
*/
@PostMapping("/bf/submit")
public AjaxResult bfSubmit(String epc, String reason,String user, String remark,List<MultipartFile> files) {
public AjaxResult bfSubmit(String epc, String reason, String user, String remark, List<MultipartFile> files) {
//插入记录
RecordInvalidated recordInvalidated = new RecordInvalidated();
recordInvalidated.setEpc(epc);
@ -296,7 +310,7 @@ public class ApiController {
e.printStackTrace();
}
System.out.println("上传图片路径:" + pathName);
apiService.insertBfImg(recordInvalidated.getObjid(),epc,user, pathName);
apiService.insertBfImg(recordInvalidated.getObjid(), epc, user, pathName);
}
}

@ -59,16 +59,22 @@ public interface ApiMapper {
void insertCheckTask(@Param("id") int id,@Param("list") List<CheckTaskInfo> list);
List<CheckTaskInfo> inspectionSelectTask(String user);
List<CheckTaskInfo> inspectionSelectTask(@Param("state") String state,
@Param("id")int id);
List<StockDto> inspectionSelectLocation(String code);
void updataInspectionTaskByObjid(long tableId);
void updataInspectionTaskByObjid( @Param("tableId")long tableId,
@Param("remark") String remark,
@Param("state") String state
);
void insertInspetionPictrue(@Param("inspetionId") long inspectionId,
@Param("tableId") long tableId,
@Param("user") String user,
@Param("pathName") String pathName);
@Param("pathName") String pathName,
@Param("locationCode") String locationCode
);
void insertBfImg(@Param("objid") Long objid,
@Param("epc") String epc,
@ -76,4 +82,8 @@ public interface ApiMapper {
@Param("pathName") String pathName);
List<CheckTaskInfo> selectLocationFromLedger();
int selectCodeFromRecode();
void deleteInspectionInfo(@Param("inspectionId") long inspectionId,@Param("locationCode") String locationCode);
}

@ -109,20 +109,20 @@ public class ApiService {
mapper.insertCheckTask(id, list);
}
public List<CheckTaskInfo> inspectionSelectTask(String user) {
return mapper.inspectionSelectTask(user);
public List<CheckTaskInfo> inspectionSelectTask(String state,int id) {
return mapper.inspectionSelectTask(state,id);
}
public List<StockDto> inspectionSelectLocation(String code) {
return mapper.inspectionSelectLocation(code);
}
public void updataInspectionTaskByObjid(long tableId) {
mapper.updataInspectionTaskByObjid(tableId);
public void updataInspectionTaskByObjid(long tableId, String remark,String state) {
mapper.updataInspectionTaskByObjid(tableId,remark,state);
}
public void insertInspetionPictrue(long inspectionId, long tableId, String user, String pathName) {
mapper.insertInspetionPictrue(inspectionId, tableId,user, pathName);
public void insertInspetionPictrue(long inspectionId, long tableId, String user, String pathName,String locationCode) {
mapper.insertInspetionPictrue(inspectionId, tableId,user, pathName,locationCode);
}
public void insertBfImg(Long objid, String epc, String user, String pathName) {
@ -132,4 +132,12 @@ public class ApiService {
public List<CheckTaskInfo> selectLocationFromLedger() {
return mapper.selectLocationFromLedger();
}
public int selectCodeFromRecode() {
return mapper.selectCodeFromRecode();
}
public void deleteInspectionInfo(String locationCode, long inspectionId) {
mapper.deleteInspectionInfo(inspectionId,locationCode);
}
}

@ -192,6 +192,7 @@
<result column="task_state" property="taskState"/>
<result column="objid" property="id"/>
<result column="area_id" property="areaId"/>
<result column="store_id" property="areaId"/>
<result column="inspection_id" property="inspectionId"/>
</resultMap>
@ -221,8 +222,14 @@
task_state,
rit.inspection_id
from record_inspection_task rit
right join record_inspection ri on rit.inspection_id = ri.inspection_id
where inspection_user = #{user}
<where>
inspection_id=#{id}
<if test="state != null and state != '全部'">
AND task_state = #{state}
</if>
</where>
</select>
<select id="inspectionSelectLocation" resultType="com.ruoyi.api.domain.StockDto">
@ -237,12 +244,12 @@
</select>
<!--完成任务-->
<update id="updataInspectionTaskByObjid">
UPDATE record_inspection_task SET task_state = '完成' WHERE objid = #{tableId};
UPDATE record_inspection_task SET task_state = #{state},remark = #{remark} WHERE objid = #{tableId};
</update>
<insert id="insertInspetionPictrue">
INSERT INTO record_inspection_img (inspection_id, task_id, img_path, create_by)
VALUES (#{inspetionId},#{tableId}, #{pathName}, #{user});
INSERT INTO record_inspection_img (inspection_id, task_id, img_path, create_by,location_code)
VALUES (#{inspetionId},#{tableId}, #{pathName}, #{user},#{locationCode});
</insert>
<insert id="insertBfImg">
@ -262,4 +269,15 @@
group by bl.location_code
order by bl.location_code
</select>
<select id="selectCodeFromRecode" resultType="int">
select inspection_id
from record_inspection
-- where date(inspection_time) = date(now())
order by inspection_time desc
limit 1
</select>
<delete id="deleteInspectionInfo">
delete from bg_wheel_chocks.record_inspection_info where inspection_id = #{inspectionId} and location_code =#{locationCode}
</delete>
</mapper>
Loading…
Cancel
Save