代码提交
This commit is contained in:
parent
e7059dde1e
commit
a7aeca314e
|
|
@ -125,6 +125,27 @@ public class ToolLedgerController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工具台账表格
|
||||||
|
*
|
||||||
|
* @param entity 实体
|
||||||
|
* @return 表格
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "工具台账表格-共享")
|
||||||
|
@GetMapping("/getToolByOrder")
|
||||||
|
public TableDataInfo getToolByOrder(ToolLedgerEntity entity) {
|
||||||
|
try {
|
||||||
|
startPage();
|
||||||
|
List<ToolLedgerEntity> list = toolLedgerService.getToolByOrder(entity);
|
||||||
|
return getDataTable(list);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.toString(), e);
|
||||||
|
}
|
||||||
|
return getDataTableError(new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出
|
* 导出
|
||||||
* @param response
|
* @param response
|
||||||
|
|
@ -152,6 +173,12 @@ public class ToolLedgerController extends BaseController {
|
||||||
public void export(HttpServletResponse response, ToolLedgerAllEntity entity) {
|
public void export(HttpServletResponse response, ToolLedgerAllEntity entity) {
|
||||||
try {
|
try {
|
||||||
List<ToolLedgerAllEntity> list = toolLedgerService.list(entity);
|
List<ToolLedgerAllEntity> list = toolLedgerService.list(entity);
|
||||||
|
list.stream()
|
||||||
|
.forEach(item -> {
|
||||||
|
String code = item.getManageMode();
|
||||||
|
String name = "0".equals(code) ? "编码管理" : "1".equals(code) ? "数量管理" : "未知管理模式";
|
||||||
|
item.setManageMode(name);
|
||||||
|
});
|
||||||
ExcelUtil<ToolLedgerAllEntity> util = new ExcelUtil<ToolLedgerAllEntity>(ToolLedgerAllEntity.class);
|
ExcelUtil<ToolLedgerAllEntity> util = new ExcelUtil<ToolLedgerAllEntity>(ToolLedgerAllEntity.class);
|
||||||
util.exportExcel(response,list,"工具台账");
|
util.exportExcel(response,list,"工具台账");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
||||||
|
|
@ -52,4 +52,5 @@ public interface ToolLedgerMapper {
|
||||||
|
|
||||||
List<ToolLedgerEntity> getToolByPro(ToolLedgerEntity entity);
|
List<ToolLedgerEntity> getToolByPro(ToolLedgerEntity entity);
|
||||||
|
|
||||||
|
List<ToolLedgerEntity> getToolByOrder(ToolLedgerEntity entity);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -156,4 +156,15 @@ public class ToolLedgerServiceImpl implements ToolLedgerService {
|
||||||
}
|
}
|
||||||
return mapper.getToolByPro(entity);
|
return mapper.getToolByPro(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ToolLedgerEntity> getToolByOrder(ToolLedgerEntity entity) {
|
||||||
|
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||||
|
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||||
|
// 管理员和省公司可查看所有数据
|
||||||
|
if (!userId.equals(ADMIN_ID) || !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
|
||||||
|
entity.setCompanyId(deptId);
|
||||||
|
}
|
||||||
|
return mapper.getToolByOrder(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,4 +31,6 @@ public interface ToolLedgerService {
|
||||||
|
|
||||||
|
|
||||||
List<ToolLedgerEntity> getToolByPro(ToolLedgerEntity entity);
|
List<ToolLedgerEntity> getToolByPro(ToolLedgerEntity entity);
|
||||||
|
|
||||||
|
List<ToolLedgerEntity> getToolByOrder(ToolLedgerEntity entity);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -332,6 +332,24 @@
|
||||||
HAVING totalNum > 0
|
HAVING totalNum > 0
|
||||||
ORDER BY cdc.pro_name ASC, cdcd.dev_code ASC
|
ORDER BY cdc.pro_name ASC, cdcd.dev_code ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getToolByOrder" resultType="com.bonus.material.toolLedger.domain.ToolLedgerEntity">
|
||||||
|
SELECT
|
||||||
|
oi.pro_name AS proName,-- 工程名称
|
||||||
|
tl.tool_code AS toolCode,-- 工具编码
|
||||||
|
tt.type_name AS typeName,-- 工具类型名称
|
||||||
|
tt1.type_name AS parentTypeName,
|
||||||
|
od.real_num AS total_num
|
||||||
|
FROM
|
||||||
|
ma_order_details od
|
||||||
|
LEFT JOIN ma_order_info oi ON oi.order_id = od.order_id
|
||||||
|
LEFT JOIN tool_ledger tl on tl.id=od.ma_id
|
||||||
|
LEFT JOIN tool_type tt ON tl.type_id = tt.type_id
|
||||||
|
LEFT JOIN tool_type tt1 ON tt1.type_id = tt.parent_id
|
||||||
|
where od.devType=#{status}
|
||||||
|
AND tl.type_id = #{typeId}
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertDevInfoProperties">
|
<insert id="insertDevInfoProperties">
|
||||||
insert into
|
insert into
|
||||||
tool_properties(tool_id, property_name, property_value, create_time)
|
tool_properties(tool_id, property_name, property_value, create_time)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue