设备基础信息 设备是否启用+设备状态

highway
A0010407 12 months ago
parent 8ce0210acb
commit 91c919ea81

@ -7,7 +7,10 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import com.op.common.core.domain.ExcelCol;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.poi.ExcelMapUtil;
import com.op.common.security.utils.SecurityUtils;
import com.op.system.api.domain.SysUser;
import com.op.wms.domain.EquSpareEquipment;
import com.op.wms.domain.WmsSparePartsLedger;
import com.op.wms.service.IBaseEquipmentService;
@ -114,7 +117,6 @@ public class BaseEquipmentController extends BaseController {
/**
*
*/
// @RequiresPermissions("wms:equipment:getEquipmentTypeList")
@GetMapping("/getEquipmentTypeList")
public TableDataInfo getEquipmentTypeList(BaseEquipment baseEquipment) {
List<BaseEquipment> list = baseEquipmentService.getEquipmentTypeList(baseEquipment);
@ -125,8 +127,8 @@ public class BaseEquipmentController extends BaseController {
*
*/
@GetMapping("/getSparePartsList")
public TableDataInfo getSparePartsList(BaseEquipment baseEquipment) {
List<WmsSparePartsLedger> list = baseEquipmentService.getSparePartsList(baseEquipment);
public TableDataInfo getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger) {
List<WmsSparePartsLedger> list = baseEquipmentService.getSparePartsList(wmsSparePartsLedger);
return getDataTable(list);
}
@ -218,4 +220,14 @@ public class BaseEquipmentController extends BaseController {
return baseEquipmentService.importFile(orderList);
}
/**
*
*/
@RequiresPermissions("wms:equipment:edit")
@Log(title = "修改设备状态", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus")
public AjaxResult changeStatus(@RequestBody BaseEquipment baseEquipment) {
return toAjax(baseEquipmentService.updateBaseEquipmentStatus(baseEquipment));
}
}

@ -61,7 +61,7 @@ public class BaseEquipment extends BaseEntity {
private String workshopName;
/** 设备状态 */
@Excel(name = "设备状态")
@Excel(name = "设备是否启用")
private String status;
/** 预留字段1 */
@ -207,6 +207,10 @@ public class BaseEquipment extends BaseEntity {
@Excel(name = "工厂号")
private String factoryCode;
/** 设备状态 */
@Excel(name = "设备状态")
private String equipmentStatus;
private String imageFileList;
private String barCodeFileList;
@ -619,6 +623,14 @@ public class BaseEquipment extends BaseEntity {
return factoryCode;
}
//设备状态
public void setEquipmentStatus(String equipmentStatus) {
this.equipmentStatus = equipmentStatus;
}
public String getEquipmentStatus() {
return equipmentStatus;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -81,7 +81,7 @@ public interface BaseEquipmentMapper {
Long getEquipmentId(String equipmentCode);
//查询备件
List<WmsSparePartsLedger> getSparePartsList(BaseEquipment baseEquipment);
List<WmsSparePartsLedger> getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger);
//绑定备品备件
public int bindSpareParts(EquSpareEquipment equSpareEquipment);
@ -107,4 +107,7 @@ public interface BaseEquipmentMapper {
//设备
BaseEquipment selectExistByEquipmentCode(String equipmentCode);
//更新设备状态
Integer updateBaseEquipmentStatus(BaseEquipment baseEquipment);
}

@ -69,11 +69,14 @@ public interface IBaseEquipmentService {
List<BaseEquipment> getEquipmentTypeList(BaseEquipment baseEquipment);
//查询设备备品备件
List<WmsSparePartsLedger> getSparePartsList(BaseEquipment baseEquipment);
List<WmsSparePartsLedger> getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger);
//查询设备备品备件右侧列表
public List<EquSpareEquipment> getRightSparePartsList(BaseEquipment baseEquipment);
//导入设备基础数据文件
AjaxResult importFile(List<BaseEquipment> equipmentList);
//更改设备状态
int updateBaseEquipmentStatus(BaseEquipment baseEquipment);
}

@ -372,8 +372,8 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
*/
@Override
@DS("#header.poolName")
public List<WmsSparePartsLedger> getSparePartsList(BaseEquipment baseEquipment) {
return baseEquipmentMapper.getSparePartsList(baseEquipment);
public List<WmsSparePartsLedger> getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger) {
return baseEquipmentMapper.getSparePartsList(wmsSparePartsLedger);
}
/**
@ -481,4 +481,19 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
return failEquipment;
}
/**
*
*
* @param baseEquipment
* @return
*/
@Override
@DS("#header.poolName")
public int updateBaseEquipmentStatus(BaseEquipment baseEquipment) {
baseEquipment.setUpdateBy(SecurityUtils.getUsername());
baseEquipment.setUpdateTime(DateUtils.getNowDate());
Integer list = baseEquipmentMapper.updateBaseEquipmentStatus(baseEquipment);
return list;
}
}

@ -47,6 +47,7 @@
<result property="sapAsset" column="sap_asset" />
<result property="equipmentHead" column="equipment_head" />
<result property="factoryCode" column="factory_code" />
<result property="equipmentStatus" column="equipment_status" />
</resultMap>
<resultMap type="WmsSparePartsLedger" id="WmsSparePartsLedgerResult">
@ -159,7 +160,9 @@
asset_head,
fixed_asset_code,
department,
equipment_head
equipment_head,
factory_code,
equipment_status
from base_equipment
</sql>
@ -201,6 +204,7 @@
<if test="department != null and department != ''"> and department = #{department}</if>
<if test="sapAsset != null and sapAsset != ''"> and sap_asset = #{sapAsset}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="equipmentStatus != null and equipmentStatus != ''"> and equipment_status = #{equipmentStatus}</if>
and del_flag ='0'
</where>
</select>
@ -254,6 +258,7 @@
<if test="sapAsset != null">sap_asset,</if>
<if test="equipmentHead != null">equipment_head,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="equipmentStatus != null">equipment_status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="equipmentCode != null and equipmentCode != ''">#{equipmentCode},</if>
@ -296,6 +301,7 @@
<if test="sapAsset != null">#{sapAsset},</if>
<if test="equipmentHead != null">#{equipmentHead},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="equipmentStatus != null">equipmentStatus,</if>
</trim>
</insert>
@ -342,6 +348,7 @@
<if test="sapAsset != null">sap_asset = #{sapAsset},</if>
<if test="equipmentHead != null">equipment_head = #{equipmentHead},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="equipmentStatus != null">equipment_status = #{equipmentStatus},</if>
</trim>
where equipment_id = #{equipmentId}
</update>
@ -514,4 +521,12 @@
and del_flag ='0'
</select>
<update id="updateBaseEquipmentStatus" parameterType="BaseEquipment">
update base_equipment
<trim prefix="SET" suffixOverrides=",">
<if test="status != null">status = #{status},</if>
</trim>
where equipment_id = #{equipmentId}
</update>
</mapper>
Loading…
Cancel
Save