仓储接收租赁装备推送逻辑优化,租赁退租时,查询装备状态以及修改装备状态的接口编写
This commit is contained in:
parent
f2d8557588
commit
e185fac396
|
|
@ -9,6 +9,7 @@ import com.bonus.sgzb.common.core.web.controller.BaseController;
|
|||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
@ -46,7 +47,7 @@ public class MaReceiveController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "获取推送数据")
|
||||
@ApiOperation(value = "查询推送数据")
|
||||
@GetMapping("/getDataReceive")
|
||||
public TableDataInfo getDataReceive(DataReceiveInfo dataReceiveInfo) {
|
||||
startPage();
|
||||
|
|
@ -92,4 +93,18 @@ public class MaReceiveController extends BaseController {
|
|||
List<DataReceiveDetail> dateReceiveMachine = maReceiveService.getDateReceiveMachine(dataReceiveDetail);
|
||||
return getDataTable(dateReceiveMachine);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取租赁设备状态")
|
||||
@GetMapping("/getItemStatus")
|
||||
public AjaxResult getDataReceiveDetailsById(Long itemId) {
|
||||
Long itemStatus = maReceiveService.getItemStatus(itemId);
|
||||
return success(itemStatus);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改租赁设备状态")
|
||||
@GetMapping("/updateItemStatus")
|
||||
public AjaxResult updateItemStatus(Long itemId) {
|
||||
Integer itemStatus = maReceiveService.updateItemStatus(itemId);
|
||||
return success(itemStatus);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,4 +87,7 @@ public class DataReceiveDetail {
|
|||
|
||||
@ApiModelProperty(value = "接收人")
|
||||
private String userIds;
|
||||
|
||||
@ApiModelProperty(value = "租赁商城装备id")
|
||||
private Long itemId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,4 +26,8 @@ public interface MaReceiveMapper {
|
|||
List<DataReceiveDetail> getDateReceiveMachine(DataReceiveDetail dataReceiveDetail);
|
||||
|
||||
int updateInfoStatus(@Param("id") Integer id);
|
||||
|
||||
Long selectMaMachineByItemId(Long itemId);
|
||||
|
||||
Integer updateItemStatus(Long itemId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,4 +20,8 @@ public interface MaReceiveService {
|
|||
int saveMachine(DataReceiveInfo dataReceiveInfo);
|
||||
|
||||
List<DataReceiveDetail> getDateReceiveMachine(DataReceiveDetail dataReceiveDetail);
|
||||
|
||||
Long getItemStatus(Long itemId);
|
||||
|
||||
Integer updateItemStatus(Long itemId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,4 +129,14 @@ public class MaReceiveServiceImpl implements MaReceiveService {
|
|||
List<DataReceiveDetail> dateReceiveMachine = maReceiveMapper.getDateReceiveMachine(dataReceiveDetail);
|
||||
return dateReceiveMachine;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getItemStatus(Long itemId) {
|
||||
return maReceiveMapper.selectMaMachineByItemId(itemId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer updateItemStatus(Long itemId) {
|
||||
return maReceiveMapper.updateItemStatus(itemId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SET receive_status = 1
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateItemStatus">
|
||||
UPDATE ma_machine mm LEFT JOIN data_receive_detail drd on mm.ma_id = drd.ma_id
|
||||
SET mm.ma_status = 130
|
||||
where drd.item_id = #{itemId}
|
||||
</update>
|
||||
<select id="getDataReceive" resultType="com.bonus.sgzb.base.domain.DataReceiveInfo">
|
||||
select * from data_receive_info where 1=1
|
||||
<if test="receiveStatus != null">
|
||||
|
|
@ -38,12 +43,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
drd.*,
|
||||
mt.type_name modelName,
|
||||
mt1.type_name typeName,
|
||||
mt2.type_name machineName
|
||||
mt2.type_name machineName,
|
||||
mm.ma_status
|
||||
FROM
|
||||
data_receive_detail drd
|
||||
LEFT JOIN ma_type mt ON drd.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id
|
||||
LEFT JOIN ma_machine mm ON drd.ma_id = mm.ma_id
|
||||
WHERE
|
||||
|
||||
drd.receive_id = #{receiveId}
|
||||
|
|
@ -85,4 +92,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getDataReceiveDetailsById" resultType="com.bonus.sgzb.base.domain.DataReceiveDetail">
|
||||
SELECT * FROM data_receive_detail WHERE receive_id = #{receiveId}
|
||||
</select>
|
||||
<select id="selectMaMachineByItemId" resultType="java.lang.Long">
|
||||
|
||||
SELECT mm.ma_status FROM ma_machine mm
|
||||
left join data_receive_detail drd on mm.ma_id = drd.ma_id
|
||||
WHERE drd.item_id = #{itemId}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue